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 | |
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')
-rw-r--r-- | src/device.rs | 1 | ||||
-rw-r--r-- | src/tests/device.rs | 48 | ||||
-rw-r--r-- | src/tests/pws.rs | 8 |
3 files changed, 21 insertions, 36 deletions
diff --git a/src/device.rs b/src/device.rs index f135261..a74310a 100644 --- a/src/device.rs +++ b/src/device.rs @@ -661,7 +661,6 @@ impl Storage { unsafe { get_command_result(nitrokey_sys::NK_lock_encrypted_volume()) } } - /// Returns the status of the connected storage device. /// /// # Example 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(); } diff --git a/src/tests/pws.rs b/src/tests/pws.rs index f581515..adb3f93 100644 --- a/src/tests/pws.rs +++ b/src/tests/pws.rs @@ -12,11 +12,9 @@ fn get_pws(device: &Target) -> PasswordSafe { #[cfg_attr(not(any(feature = "test-pro", feature = "test-storage")), ignore)] fn enable() { let device = Target::connect().unwrap(); - assert!( - device - .get_password_safe(&(USER_PASSWORD.to_owned() + "123")) - .is_err() - ); + assert!(device + .get_password_safe(&(USER_PASSWORD.to_owned() + "123")) + .is_err()); assert!(device.get_password_safe(USER_PASSWORD).is_ok()); assert!(device.get_password_safe(ADMIN_PASSWORD).is_err()); assert!(device.get_password_safe(USER_PASSWORD).is_ok()); |