From 05b6f4679ab79e4f2591d6c2a5371a04b0a5b5a7 Mon Sep 17 00:00:00 2001 From: Devin R Date: Sun, 29 Mar 2020 08:07:25 -0400 Subject: [PATCH] cargo fmt/clippy --- src/async_client.rs | 9 ++++++--- src/models/room_member.rs | 13 ++++++------- src/models/user.rs | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/async_client.rs b/src/async_client.rs index e9627682..6b4c7862 100644 --- a/src/async_client.rs +++ b/src/async_client.rs @@ -30,9 +30,9 @@ use url::Url; use ruma_api::{Endpoint, Outgoing}; use ruma_events::collections::all::RoomEvent; +use ruma_events::presence::PresenceEvent; use ruma_events::room::message::MessageEventContent; use ruma_events::EventResult; -use ruma_events::presence::PresenceEvent; pub use ruma_events::EventType; use ruma_identifiers::RoomId; @@ -48,7 +48,8 @@ type RoomEventCallback = Box< >; type PresenceEventCallback = Box< - dyn FnMut(Arc>, Arc>) -> BoxFuture<'static, ()> + Send, + dyn FnMut(Arc>, Arc>) -> BoxFuture<'static, ()> + + Send, >; const DEFAULT_SYNC_TIMEOUT: Duration = Duration::from_secs(30); @@ -405,7 +406,9 @@ impl AsyncClient { /// ``` pub fn add_presence_callback( &mut self, - mut callback: impl FnMut(Arc>, Arc>) -> C + 'static + Send, + mut callback: impl FnMut(Arc>, Arc>) -> C + + 'static + + Send, ) where C: Future + Send, { diff --git a/src/models/room_member.rs b/src/models/room_member.rs index 99799bad..c6803f5d 100644 --- a/src/models/room_member.rs +++ b/src/models/room_member.rs @@ -87,13 +87,12 @@ impl RoomMember { self.user.display_name = event.content.displayname.clone(); self.user.avatar_url = event.content.avatar_url.clone(); true - }, - Banned | Kicked | KickedAndBanned - | InvitationRejected | InvitationRevoked - | Left | Unbanned | Joined | Invited => { - self.membership = event.content.membership; - true - }, + } + Banned | Kicked | KickedAndBanned | InvitationRejected | InvitationRevoked | Left + | Unbanned | Joined | Invited => { + self.membership = event.content.membership; + true + } NotImplemented => false, None => false, // TODO should this be handled somehow ?? diff --git a/src/models/user.rs b/src/models/user.rs index 2c5c4d57..786bad6e 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -104,7 +104,7 @@ impl User { } /// Updates the `User`s presence. - /// + /// /// This should only be used if `did_update_presence` was true. /// /// # Arguments @@ -123,7 +123,7 @@ impl User { }, .. } = presence_ev; - + self.presence_events.push(presence_ev.clone()); *self = User { display_name: displayname.clone(),