crypto: Clippy fixes for our tests.

master
Damir Jelić 2020-07-15 15:58:36 +02:00
parent a2a87b9fff
commit 5bebe1d434
4 changed files with 9 additions and 9 deletions

View File

@ -292,8 +292,8 @@ mod test {
let user_devices = store.user_devices(device.user_id()); let user_devices = store.user_devices(device.user_id());
assert_eq!(user_devices.keys().nth(0).unwrap(), device.device_id()); assert_eq!(user_devices.keys().next().unwrap(), device.device_id());
assert_eq!(user_devices.devices().nth(0).unwrap(), &device); assert_eq!(user_devices.devices().next().unwrap(), &device);
let loaded_device = user_devices.get(device.device_id()).unwrap(); let loaded_device = user_devices.get(device.device_id()).unwrap();

View File

@ -1066,7 +1066,7 @@ pub(crate) mod test {
.await .await
.curve25519() .curve25519()
.iter() .iter()
.nth(0) .next()
.unwrap() .unwrap()
.1 .1
.to_owned(); .to_owned();
@ -1143,7 +1143,7 @@ pub(crate) mod test {
let one_time_key = one_time_keys let one_time_key = one_time_keys
.curve25519() .curve25519()
.iter() .iter()
.nth(0) .next()
.unwrap() .unwrap()
.1 .1
.to_owned(); .to_owned();

View File

@ -200,8 +200,8 @@ mod test {
let user_devices = store.get_user_devices(device.user_id()).await.unwrap(); 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.keys().next().unwrap(), device.device_id());
assert_eq!(user_devices.devices().nth(0).unwrap(), &device); assert_eq!(user_devices.devices().next().unwrap(), &device);
let loaded_device = user_devices.get(device.device_id()).unwrap(); let loaded_device = user_devices.get(device.device_id()).unwrap();

View File

@ -866,7 +866,7 @@ mod test {
.await .await
.curve25519() .curve25519()
.iter() .iter()
.nth(0) .next()
.unwrap() .unwrap()
.1 .1
.to_owned(); .to_owned();
@ -1165,8 +1165,8 @@ mod test {
assert_eq!(device.keys(), loaded_device.keys()); assert_eq!(device.keys(), loaded_device.keys());
let user_devices = store.get_user_devices(device.user_id()).await.unwrap(); 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.keys().next().unwrap(), device.device_id());
assert_eq!(user_devices.devices().nth(0).unwrap(), &device); assert_eq!(user_devices.devices().next().unwrap(), &device);
} }
#[tokio::test] #[tokio::test]