From 037d62b165706ebd45b3e134ca5d0ed196a271a3 Mon Sep 17 00:00:00 2001 From: Devin R Date: Mon, 20 Jul 2020 08:10:42 -0400 Subject: [PATCH] matrix-sdk-crypto: Remove map clone from user_devices --- matrix_sdk_crypto/src/memory_stores.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/matrix_sdk_crypto/src/memory_stores.rs b/matrix_sdk_crypto/src/memory_stores.rs index 7389eb2f..7cf6351c 100644 --- a/matrix_sdk_crypto/src/memory_stores.rs +++ b/matrix_sdk_crypto/src/memory_stores.rs @@ -197,18 +197,12 @@ impl DeviceStore { } /// Get a read-only view over all devices of the given user. - #[allow(clippy::map_clone)] pub fn user_devices(&self, user_id: &UserId) -> UserDevices { if !self.entries.contains_key(user_id) { self.entries.insert(user_id.clone(), DashMap::new()); } UserDevices { - entries: self - .entries - .get(user_id) - .map(|map| map.clone()) // TODO I'm sure this is not ok but I'm not sure what to do?? - .unwrap() - .into_read_only(), + entries: self.entries.get(user_id).unwrap().clone().into_read_only(), } } }