crypto: Fix a couple clippy warnings

This commit is contained in:
Damir Jelić 2021-01-18 13:50:59 +01:00
parent 1746690eda
commit 436530e874
2 changed files with 4 additions and 3 deletions

View file

@ -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<Box<dyn CryptoStore>> = 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,

View file

@ -127,6 +127,7 @@ impl GroupSessionManager {
room_id: &RoomId,
settings: EncryptionSettings,
) -> OlmResult<(OutboundGroupSession, Option<InboundGroupSession>)> {
#[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<DeviceIdBox> =
user_devices.keys().map(|d| d.clone()).collect();
let device_ids: HashSet<DeviceIdBox> = 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<DeviceIdBox> = shared.iter().map(|d| d.clone()).collect();
!shared
.difference(&device_ids)