diff --git a/crates/matrix-sdk/src/event_handler.rs b/crates/matrix-sdk/src/event_handler.rs index 13e131a87..3f491543b 100644 --- a/crates/matrix-sdk/src/event_handler.rs +++ b/crates/matrix-sdk/src/event_handler.rs @@ -178,7 +178,7 @@ impl EventHandlerContext for EventHandlerHandle { /// /// ยน the only thing stopping such types from existing in stable Rust is that /// all manual implementations of the `Fn` traits require a Nightly feature -pub trait EventHandler: Clone + Send + Sync + 'static { +pub trait EventHandler: Send + Sync + 'static { /// The future returned by `handle_event`. #[doc(hidden)] type Future: Future + Send + 'static; @@ -327,8 +327,8 @@ impl Client { ::Output: EventHandlerResult, { let handler_fn: Box = Box::new(move |data| { - let maybe_fut = serde_json::from_str(data.raw.get()) - .map(|ev| handler.clone().handle_event(ev, data)); + let maybe_fut = + serde_json::from_str(data.raw.get()).map(|ev| handler.handle_event(ev, data)); Box::pin(async move { match maybe_fut { @@ -539,7 +539,7 @@ macro_rules! impl_event_handler { impl EventHandler for Fun where Ev: SyncEvent, - Fun: Fn(Ev, $($ty),*) -> Fut + Clone + Send + Sync + 'static, + Fun: Fn(Ev, $($ty),*) -> Fut + Send + Sync + 'static, Fut: Future + Send + 'static, Fut::Output: EventHandlerResult, $($ty: EventHandlerContext),*