summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
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();
+ }
}
}