From cea0aed29feef1d07d91670ea63cd6af45efdfee Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 28 May 2018 18:14:14 +0000 Subject: Rewrap documentation comments to 100 characters --- src/device.rs | 53 ++++++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) (limited to 'src/device.rs') diff --git a/src/device.rs b/src/device.rs index d24bf51..277218e 100644 --- a/src/device.rs +++ b/src/device.rs @@ -140,9 +140,8 @@ pub struct Admin { /// This trait provides the commands that can be executed without authentication and that are /// present on all supported Nitrokey devices. pub trait Device: GenerateOtp { - /// Sets the time on the Nitrokey. This command may set the time to - /// arbitrary values. `time` is the number of seconds since January 1st, - /// 1970 (Unix timestamp). + /// Sets the time on the Nitrokey. This command may set the time to arbitrary values. `time` + /// is the number of seconds since January 1st, 1970 (Unix timestamp). /// /// The time is used for TOTP generation (see [`get_totp_code`][]). /// @@ -177,8 +176,8 @@ pub trait Device: GenerateOtp { unsafe { CommandStatus::from(nitrokey_sys::NK_totp_set_time(time)) } } - /// Returns the serial number of the Nitrokey device. The serial number - /// is the string representation of a hex number. + /// Returns the serial number of the Nitrokey device. The serial number is the string + /// representation of a hex number. /// /// # Example /// @@ -199,8 +198,8 @@ pub trait Device: GenerateOtp { unsafe { result_from_string(nitrokey_sys::NK_device_serial_number()) } } - /// Returns the number of remaining authentication attempts for the user. The - /// total number of available attempts is three. + /// Returns the number of remaining authentication attempts for the user. The total number of + /// available attempts is three. /// /// # Example /// @@ -219,8 +218,8 @@ pub trait Device: GenerateOtp { unsafe { nitrokey_sys::NK_get_user_retry_count() } } - /// Returns the number of remaining authentication attempts for the admin. The - /// total number of available attempts is three. + /// Returns the number of remaining authentication attempts for the admin. The total number of + /// available attempts is three. /// /// # Example /// @@ -261,8 +260,7 @@ pub trait Device: GenerateOtp { unsafe { nitrokey_sys::NK_get_major_firmware_version() } } - /// Returns the minor part of the firmware version (for example 8 for - /// version 0.8). + /// Returns the minor part of the firmware version (for example 8 for version 0.8). /// /// # Example /// @@ -401,8 +399,8 @@ trait AuthenticatedDevice { fn new(device: T, temp_password: Vec) -> Self; } -/// Connects to a Nitrokey device. This method can be used to connect to any -/// connected device, both a Nitrokey Pro and a Nitrokey Storage. +/// Connects to a Nitrokey device. This method can be used to connect to any connected device, +/// both a Nitrokey Pro and a Nitrokey Storage. /// /// # Example /// @@ -579,18 +577,17 @@ impl AsRef for User { } impl User { - /// Forgets the user authentication and returns an unauthenticated - /// device. This method consumes the authenticated device. It does not - /// perform any actual commands on the Nitrokey. + /// Forgets the user authentication and returns an unauthenticated device. This method + /// consumes the authenticated device. It does not perform any actual commands on the + /// Nitrokey. pub fn device(self) -> T { self.device } } impl GenerateOtp for User { - /// Generates an HOTP code on the given slot. This operation may not - /// require user authorization, depending on the device configuration (see - /// [`get_config`][]). + /// Generates an HOTP code on the given slot. This operation may not require user + /// authorization, depending on the device configuration (see [`get_config`][]). /// /// # Errors /// @@ -626,12 +623,11 @@ impl GenerateOtp for User { } } - /// Generates a TOTP code on the given slot. This operation may not - /// require user authorization, depending on the device configuration (see - /// [`get_config`][]). + /// Generates a TOTP code on the given slot. This operation may not require user + /// authorization, depending on the device configuration (see [`get_config`][]). /// - /// To make sure that the Nitrokey’s time is in sync, consider calling - /// [`set_time`][] before calling this method. + /// To make sure that the Nitrokey’s time is in sync, consider calling [`set_time`][] before + /// calling this method. /// /// # Errors /// @@ -697,9 +693,9 @@ impl AsRef for Admin { } impl Admin { - /// Forgets the user authentication and returns an unauthenticated - /// device. This method consumes the authenticated device. It does not - /// perform any actual commands on the Nitrokey. + /// Forgets the user authentication and returns an unauthenticated device. This method + /// consumes the authenticated device. It does not perform any actual commands on the + /// Nitrokey. pub fn device(self) -> T { self.device } @@ -708,8 +704,7 @@ impl Admin { /// /// # Errors /// - /// - [`InvalidSlot`][] if the provided numlock, capslock or scrolllock - /// slot is larger than two + /// - [`InvalidSlot`][] if the provided numlock, capslock or scrolllock slot is larger than two /// /// # Example /// -- cgit v1.2.1