From 3e496dba506e0ae2201f995126492c8dfbb36612 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 23 Jan 2022 13:30:56 +0100 Subject: [PATCH] Remove unnecessary .iter() calls --- crates/matrix-sdk-crypto/src/olm/account.rs | 2 +- crates/matrix-sdk-crypto/src/store/sled.rs | 2 +- crates/matrix-sdk-crypto/src/verification/sas/helpers.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/matrix-sdk-crypto/src/olm/account.rs b/crates/matrix-sdk-crypto/src/olm/account.rs index 67af1d7f4..4372e74fb 100644 --- a/crates/matrix-sdk-crypto/src/olm/account.rs +++ b/crates/matrix-sdk-crypto/src/olm/account.rs @@ -866,7 +866,7 @@ impl ReadOnlyAccount { let one_time_keys = self.one_time_keys().await; let mut one_time_key_map = BTreeMap::new(); - for (key_id, key) in one_time_keys.curve25519().iter() { + for (key_id, key) in one_time_keys.curve25519() { let key_json = json!({ "key": key, }); diff --git a/crates/matrix-sdk-crypto/src/store/sled.rs b/crates/matrix-sdk-crypto/src/store/sled.rs index 8b1ba4e12..5c87d723b 100644 --- a/crates/matrix-sdk-crypto/src/store/sled.rs +++ b/crates/matrix-sdk-crypto/src/store/sled.rs @@ -424,7 +424,7 @@ impl SledStore { } async fn load_tracked_users(&self) -> Result<()> { - for value in self.tracked_users.iter() { + for value in &self.tracked_users { let (user, dirty) = value?; let user = Box::::try_from(String::from_utf8_lossy(&user).to_string())?; let dirty = dirty.get(0).map(|d| *d == 1).unwrap_or(true); diff --git a/crates/matrix-sdk-crypto/src/verification/sas/helpers.rs b/crates/matrix-sdk-crypto/src/verification/sas/helpers.rs index c7df219c1..4e50b193f 100644 --- a/crates/matrix-sdk-crypto/src/verification/sas/helpers.rs +++ b/crates/matrix-sdk-crypto/src/verification/sas/helpers.rs @@ -606,8 +606,8 @@ mod test { fn proptest_emoji(bytes in prop::array::uniform6(0u8..)) { let numbers = bytes_to_emoji_index(bytes.to_vec()); - for number in numbers.iter() { - prop_assert!(*number < 64); + for number in numbers { + prop_assert!(number < 64); } } }