diff --git a/Cargo.lock b/Cargo.lock index 6353ef6e4..a81a84270 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1189,7 +1189,6 @@ dependencies = [ "parking_lot", "percent-encoding", "pgp", - "pin-project", "pretty_assertions", "pretty_env_logger", "proptest", diff --git a/Cargo.toml b/Cargo.toml index cf63ac843..58f6cd8bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,6 @@ once_cell = { workspace = true } percent-encoding = "2.3" parking_lot = "0.12" pgp = { version = "0.11", default-features = false } -pin-project = "1" pretty_env_logger = { version = "0.5", optional = true } qrcodegen = "1.7.0" quick-xml = "0.31" diff --git a/src/events.rs b/src/events.rs index 62b369d31..dcbee99d3 100644 --- a/src/events.rs +++ b/src/events.rs @@ -1,7 +1,6 @@ //! # Events specification. use async_channel::{self as channel, Receiver, Sender, TrySendError}; -use pin_project::pin_project; pub(crate) mod chatlist_events; mod payload; @@ -60,14 +59,10 @@ impl Events { /// created events emitted by the [`Context`] will only be delivered to one of the /// `EventEmitter`s. /// -/// The `EventEmitter` is also a [`Stream`], so a typical usage is in a `while let` loop. -/// /// [`Context`]: crate::context::Context /// [`Context::get_event_emitter`]: crate::context::Context::get_event_emitter -/// [`Stream`]: futures::stream::Stream #[derive(Debug, Clone)] -#[pin_project] -pub struct EventEmitter(#[pin] Receiver); +pub struct EventEmitter(Receiver); impl EventEmitter { /// Async recv of an event. Return `None` if the `Sender` has been dropped. @@ -76,17 +71,6 @@ impl EventEmitter { } } -impl futures::stream::Stream for EventEmitter { - type Item = Event; - - fn poll_next( - self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - self.project().0.poll_next(cx) - } -} - /// The event emitted by a [`Context`] from an [`EventEmitter`]. /// /// Events are documented on the C/FFI API in `deltachat.h` as `DC_EVENT_*` constants. The