diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2018-12-16 12:28:13 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2018-12-16 12:28:13 +0100 |
commit | d1a5e9f9547d804fb329dc41c5f5e0ce287e2215 (patch) | |
tree | 54db34900e703de8c5621d52184bc5baa48538ce /src/tests/device.rs | |
parent | 2eccc96ceec2282b868891befe9cda7f941fbe7b (diff) | |
download | nitrokey-rs-d1a5e9f9547d804fb329dc41c5f5e0ce287e2215.tar.gz nitrokey-rs-d1a5e9f9547d804fb329dc41c5f5e0ce287e2215.tar.bz2 |
Fix formatting according to Rust style guide
Diffstat (limited to 'src/tests/device.rs')
-rw-r--r-- | src/tests/device.rs | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/src/tests/device.rs b/src/tests/device.rs index fed465d..1f583e0 100644 --- a/src/tests/device.rs +++ b/src/tests/device.rs @@ -163,11 +163,9 @@ fn change_user_pin() { let device = device.authenticate_user(USER_PASSWORD).unwrap().device(); let device = device.authenticate_user(USER_NEW_PASSWORD).unwrap_err().0; - assert!( - device - .change_user_pin(USER_PASSWORD, USER_NEW_PASSWORD) - .is_ok() - ); + assert!(device + .change_user_pin(USER_PASSWORD, USER_NEW_PASSWORD) + .is_ok()); let device = device.authenticate_user(USER_PASSWORD).unwrap_err().0; let device = device @@ -178,11 +176,9 @@ fn change_user_pin() { let result = device.change_user_pin(USER_PASSWORD, USER_PASSWORD); assert_eq!(Err(CommandError::WrongPassword), result); - assert!( - device - .change_user_pin(USER_NEW_PASSWORD, USER_PASSWORD) - .is_ok() - ); + assert!(device + .change_user_pin(USER_NEW_PASSWORD, USER_PASSWORD) + .is_ok()); let device = device.authenticate_user(USER_PASSWORD).unwrap().device(); assert!(device.authenticate_user(USER_NEW_PASSWORD).is_err()); @@ -195,11 +191,9 @@ fn change_admin_pin() { let device = device.authenticate_admin(ADMIN_PASSWORD).unwrap().device(); let device = device.authenticate_admin(ADMIN_NEW_PASSWORD).unwrap_err().0; - assert!( - device - .change_admin_pin(ADMIN_PASSWORD, ADMIN_NEW_PASSWORD) - .is_ok() - ); + assert!(device + .change_admin_pin(ADMIN_PASSWORD, ADMIN_NEW_PASSWORD) + .is_ok()); let device = device.authenticate_admin(ADMIN_PASSWORD).unwrap_err().0; let device = device @@ -212,11 +206,9 @@ fn change_admin_pin() { device.change_admin_pin(ADMIN_PASSWORD, ADMIN_PASSWORD) ); - assert!( - device - .change_admin_pin(ADMIN_NEW_PASSWORD, ADMIN_PASSWORD) - .is_ok() - ); + assert!(device + .change_admin_pin(ADMIN_NEW_PASSWORD, ADMIN_PASSWORD) + .is_ok()); let device = device.authenticate_admin(ADMIN_PASSWORD).unwrap().device(); device.authenticate_admin(ADMIN_NEW_PASSWORD).unwrap_err(); @@ -235,11 +227,9 @@ fn require_failed_user_login(device: Target, password: &str, error: CommandError fn unlock_user_pin() { let device = Target::connect().unwrap(); let device = device.authenticate_user(USER_PASSWORD).unwrap().device(); - assert!( - device - .unlock_user_pin(ADMIN_PASSWORD, USER_PASSWORD) - .is_ok() - ); + assert!(device + .unlock_user_pin(ADMIN_PASSWORD, USER_PASSWORD) + .is_ok()); assert_eq!( Err(CommandError::WrongPassword), device.unlock_user_pin(USER_PASSWORD, USER_PASSWORD) @@ -255,11 +245,9 @@ fn unlock_user_pin() { Err(CommandError::WrongPassword), device.unlock_user_pin(USER_PASSWORD, USER_PASSWORD) ); - assert!( - device - .unlock_user_pin(ADMIN_PASSWORD, USER_PASSWORD) - .is_ok() - ); + assert!(device + .unlock_user_pin(ADMIN_PASSWORD, USER_PASSWORD) + .is_ok()); device.authenticate_user(USER_PASSWORD).unwrap(); } |