cargo fmt/clippy

master
Devin R 2020-03-29 08:07:25 -04:00
parent 4c7acd4b18
commit 05b6f4679a
3 changed files with 14 additions and 12 deletions

View File

@ -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<SyncLock<Room>>, Arc<EventResult<PresenceEvent>>) -> BoxFuture<'static, ()> + Send,
dyn FnMut(Arc<SyncLock<Room>>, Arc<EventResult<PresenceEvent>>) -> BoxFuture<'static, ()>
+ Send,
>;
const DEFAULT_SYNC_TIMEOUT: Duration = Duration::from_secs(30);
@ -405,7 +406,9 @@ impl AsyncClient {
/// ```
pub fn add_presence_callback<C: 'static>(
&mut self,
mut callback: impl FnMut(Arc<SyncLock<Room>>, Arc<EventResult<PresenceEvent>>) -> C + 'static + Send,
mut callback: impl FnMut(Arc<SyncLock<Room>>, Arc<EventResult<PresenceEvent>>) -> C
+ 'static
+ Send,
) where
C: Future<Output = ()> + Send,
{

View File

@ -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 => {
}
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 ??