diff --git a/matrix_sdk_crypto/src/memory_stores.rs b/matrix_sdk_crypto/src/memory_stores.rs index be7aba34..f38f476e 100644 --- a/matrix_sdk_crypto/src/memory_stores.rs +++ b/matrix_sdk_crypto/src/memory_stores.rs @@ -292,8 +292,8 @@ mod test { let user_devices = store.user_devices(device.user_id()); - assert_eq!(user_devices.keys().nth(0).unwrap(), device.device_id()); - assert_eq!(user_devices.devices().nth(0).unwrap(), &device); + assert_eq!(user_devices.keys().next().unwrap(), device.device_id()); + assert_eq!(user_devices.devices().next().unwrap(), &device); let loaded_device = user_devices.get(device.device_id()).unwrap(); diff --git a/matrix_sdk_crypto/src/olm.rs b/matrix_sdk_crypto/src/olm.rs index aece7912..5c4f6f0d 100644 --- a/matrix_sdk_crypto/src/olm.rs +++ b/matrix_sdk_crypto/src/olm.rs @@ -1066,7 +1066,7 @@ pub(crate) mod test { .await .curve25519() .iter() - .nth(0) + .next() .unwrap() .1 .to_owned(); @@ -1143,7 +1143,7 @@ pub(crate) mod test { let one_time_key = one_time_keys .curve25519() .iter() - .nth(0) + .next() .unwrap() .1 .to_owned(); diff --git a/matrix_sdk_crypto/src/store/memorystore.rs b/matrix_sdk_crypto/src/store/memorystore.rs index ccef2efd..a911320f 100644 --- a/matrix_sdk_crypto/src/store/memorystore.rs +++ b/matrix_sdk_crypto/src/store/memorystore.rs @@ -200,8 +200,8 @@ mod test { let user_devices = store.get_user_devices(device.user_id()).await.unwrap(); - assert_eq!(user_devices.keys().nth(0).unwrap(), device.device_id()); - assert_eq!(user_devices.devices().nth(0).unwrap(), &device); + assert_eq!(user_devices.keys().next().unwrap(), device.device_id()); + assert_eq!(user_devices.devices().next().unwrap(), &device); let loaded_device = user_devices.get(device.device_id()).unwrap(); diff --git a/matrix_sdk_crypto/src/store/sqlite.rs b/matrix_sdk_crypto/src/store/sqlite.rs index bfa26664..cfda0a62 100644 --- a/matrix_sdk_crypto/src/store/sqlite.rs +++ b/matrix_sdk_crypto/src/store/sqlite.rs @@ -866,7 +866,7 @@ mod test { .await .curve25519() .iter() - .nth(0) + .next() .unwrap() .1 .to_owned(); @@ -1165,8 +1165,8 @@ mod test { assert_eq!(device.keys(), loaded_device.keys()); let user_devices = store.get_user_devices(device.user_id()).await.unwrap(); - assert_eq!(user_devices.keys().nth(0).unwrap(), device.device_id()); - assert_eq!(user_devices.devices().nth(0).unwrap(), &device); + assert_eq!(user_devices.keys().next().unwrap(), device.device_id()); + assert_eq!(user_devices.devices().next().unwrap(), &device); } #[tokio::test]