aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2018-05-21 23:27:55 +0000
committerRobin Krahl <robin.krahl@ireas.org>2018-05-22 01:28:03 +0200
commit2a736067581dd44288b43a01bf47e0d28801e0a8 (patch)
tree817f158d05bdfb2d05a74ee157709d7740c33fc2 /src/lib.rs
parente55f358ea5ae1ea3df3cb66fd9ae3e3597abfc73 (diff)
downloadnitrokey-rs-2a736067581dd44288b43a01bf47e0d28801e0a8.tar.gz
nitrokey-rs-2a736067581dd44288b43a01bf47e0d28801e0a8.tar.bz2
Correct formatting
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 53b0c6c..235c81b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -616,7 +616,7 @@ pub trait Device {
/// Changes the administrator PIN.
///
/// # Errors
- ///
+ ///
/// - [`InvalidString`][] if one of the provided passwords contains a null byte
/// - [`WrongPassword`][] if the current admin password is wrong
///
@@ -646,13 +646,18 @@ pub trait Device {
}
let current_string = current_string.unwrap();
let new_string = new_string.unwrap();
- unsafe { CommandStatus::from(nitrokey_sys::NK_change_admin_PIN(current_string.as_ptr(), new_string.as_ptr())) }
+ unsafe {
+ CommandStatus::from(nitrokey_sys::NK_change_admin_PIN(
+ current_string.as_ptr(),
+ new_string.as_ptr(),
+ ))
+ }
}
/// Changes the user PIN.
///
/// # Errors
- ///
+ ///
/// - [`InvalidString`][] if one of the provided passwords contains a null byte
/// - [`WrongPassword`][] if the current user password is wrong
///
@@ -682,7 +687,12 @@ pub trait Device {
}
let current_string = current_string.unwrap();
let new_string = new_string.unwrap();
- unsafe { CommandStatus::from(nitrokey_sys::NK_change_user_PIN(current_string.as_ptr(), new_string.as_ptr())) }
+ unsafe {
+ CommandStatus::from(nitrokey_sys::NK_change_user_PIN(
+ current_string.as_ptr(),
+ new_string.as_ptr(),
+ ))
+ }
}
}
@@ -1088,7 +1098,9 @@ impl UnauthenticatedDevice {
impl Drop for UnauthenticatedDevice {
fn drop(&mut self) {
- unsafe { nitrokey_sys::NK_logout(); }
+ unsafe {
+ nitrokey_sys::NK_logout();
+ }
}
}