aboutsummaryrefslogtreecommitdiff
path: root/src/device/storage.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-01-11 20:13:22 +0100
committerRobin Krahl <robin.krahl@ireas.org>2020-01-11 20:26:40 +0100
commit6142752da1563c1ab873dc7069aeec72522cca99 (patch)
treebb6fe9eca8cbd5e32d4b133b57d90466c4bc9b8e /src/device/storage.rs
parentdbee55efa41496c8a683bfab96163facc93d6639 (diff)
downloadnitrokey-rs-6142752da1563c1ab873dc7069aeec72522cca99.tar.gz
nitrokey-rs-6142752da1563c1ab873dc7069aeec72522cca99.tar.bz2
Rename Status::get_status to get_storage_status
In the last patch, we added the get_status function to the Device trait. This patch renames the Storage::get_status function to get_storage_status to resolve the name clash – though allowed by the compiler, it is rather confusing for the end user.
Diffstat (limited to 'src/device/storage.rs')
-rw-r--r--src/device/storage.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/device/storage.rs b/src/device/storage.rs
index 64e6848..08ec4e9 100644
--- a/src/device/storage.rs
+++ b/src/device/storage.rs
@@ -525,7 +525,7 @@ impl<'a> Storage<'a> {
/// # fn try_main() -> Result<(), Error> {
/// let mut manager = nitrokey::take()?;
/// let device = manager.connect_storage()?;
- /// match device.get_status() {
+ /// match device.get_storage_status() {
/// Ok(status) => {
/// println!("SD card ID: {:#x}", status.serial_number_sd_card);
/// },
@@ -534,7 +534,7 @@ impl<'a> Storage<'a> {
/// # Ok(())
/// # }
/// ```
- pub fn get_status(&self) -> Result<StorageStatus, Error> {
+ pub fn get_storage_status(&self) -> Result<StorageStatus, Error> {
let mut raw_status = nitrokey_sys::NK_storage_status {
unencrypted_volume_read_only: false,
unencrypted_volume_active: false,
@@ -682,8 +682,8 @@ impl<'a> Device<'a> for Storage<'a> {
fn get_status(&self) -> Result<Status, Error> {
// Currently, the GET_STATUS command does not report the correct firmware version and
// serial number on the Nitrokey Storage, see [0]. Until this is fixed in libnitrokey, we
- // have to manually execute the GET_DEVICE_STATUS command (Storage::get_status) and
- // complete the missing data, see [1].
+ // have to manually execute the GET_DEVICE_STATUS command (get_storage_status) and complete
+ // the missing data, see [1].
// [0] https://github.com/Nitrokey/nitrokey-storage-firmware/issues/96
// [1] https://github.com/Nitrokey/libnitrokey/issues/166
@@ -699,7 +699,7 @@ impl<'a> Device<'a> for Storage<'a> {
get_command_result(unsafe { nitrokey_sys::NK_get_status(&mut raw_status) })?;
let mut status = Status::from(raw_status);
- let storage_status = Storage::get_status(&self)?;
+ let storage_status = self.get_storage_status()?;
status.firmware_version = storage_status.firmware_version;
status.serial_number = storage_status.serial_number_smart_card;