From 436530e8740066420d33f74b0c6c1d0e1e53dd0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 18 Jan 2021 13:50:59 +0100 Subject: [PATCH] crypto: Fix a couple clippy warnings --- matrix_sdk_crypto/src/identities/manager.rs | 2 +- matrix_sdk_crypto/src/session_manager/group_sessions.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/matrix_sdk_crypto/src/identities/manager.rs b/matrix_sdk_crypto/src/identities/manager.rs index 940009a7..1333fadd 100644 --- a/matrix_sdk_crypto/src/identities/manager.rs +++ b/matrix_sdk_crypto/src/identities/manager.rs @@ -395,7 +395,7 @@ pub(crate) mod test { let user_id = Arc::new(user_id()); let account = ReadOnlyAccount::new(&user_id, &device_id()); let store: Arc> = Arc::new(Box::new(MemoryStore::new())); - let verification = VerificationMachine::new(account.clone(), identity.clone(), store); + let verification = VerificationMachine::new(account, identity.clone(), store); let store = Store::new( user_id.clone(), identity, diff --git a/matrix_sdk_crypto/src/session_manager/group_sessions.rs b/matrix_sdk_crypto/src/session_manager/group_sessions.rs index 422b1973..e63985ff 100644 --- a/matrix_sdk_crypto/src/session_manager/group_sessions.rs +++ b/matrix_sdk_crypto/src/session_manager/group_sessions.rs @@ -127,6 +127,7 @@ impl GroupSessionManager { room_id: &RoomId, settings: EncryptionSettings, ) -> OlmResult<(OutboundGroupSession, Option)> { + #[allow(clippy::map_clone)] if let Some(s) = self.outbound_group_sessions.get(room_id).map(|s| s.clone()) { if s.expired() || s.invalidated() { self.create_outbound_group_session(room_id, settings) @@ -189,10 +190,10 @@ impl GroupSessionManager { let user_devices = self.store.get_user_devices(&user_id).await?; if !device_got_deleted { - let device_ids: HashSet = - user_devices.keys().map(|d| d.clone()).collect(); + let device_ids: HashSet = user_devices.keys().cloned().collect(); device_got_deleted = if let Some(shared) = outbound.shared_with_set.get(user_id) { + #[allow(clippy::map_clone)] let shared: HashSet = shared.iter().map(|d| d.clone()).collect(); !shared .difference(&device_ids)