aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2018-05-28 18:18:47 +0000
committerRobin Krahl <robin.krahl@ireas.org>2018-05-28 20:19:45 +0200
commit1ceea28c65b60c31c6c2667cd6de90935e4b9dc1 (patch)
treeb2934a0d718e46c811abd930aa89153d1e1622b1
parentcea0aed29feef1d07d91670ea63cd6af45efdfee (diff)
downloadnitrokey-rs-1ceea28c65b60c31c6c2667cd6de90935e4b9dc1.tar.gz
nitrokey-rs-1ceea28c65b60c31c6c2667cd6de90935e4b9dc1.tar.bz2
Remove duplicated documentation comment
The defnition of the ConfigureOtp trait already contains documentation comments, therefore the comments in the implementation for User<T> can be removed.
-rw-r--r--src/device.rs64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/device.rs b/src/device.rs
index 277218e..7387dd9 100644
--- a/src/device.rs
+++ b/src/device.rs
@@ -586,36 +586,6 @@ impl<T: Device> User<T> {
}
impl<T: Device> GenerateOtp for User<T> {
- /// Generates an HOTP code on the given slot. This operation may not require user
- /// authorization, depending on the device configuration (see [`get_config`][]).
- ///
- /// # Errors
- ///
- /// - [`SlotNotProgrammed`][] if the given slot is not configured
- /// - [`WrongSlot`][] if there is no slot with the given number
- ///
- /// # Example
- ///
- /// ```no_run
- /// use nitrokey::{Authenticate, GenerateOtp};
- /// # use nitrokey::CommandError;
- ///
- /// # fn try_main() -> Result<(), CommandError> {
- /// let device = nitrokey::connect()?;
- /// match device.authenticate_user("123456") {
- /// Ok(user) => {
- /// let code = user.get_hotp_code(1)?;
- /// println!("Generated HOTP code on slot 1: {:?}", code);
- /// },
- /// Err(err) => println!("Could not authenticate: {:?}", err),
- /// };
- /// # Ok(())
- /// # }
- /// ```
- ///
- /// [`get_config`]: trait.Device.html#method.get_config
- /// [`SlotNotProgrammed`]: enum.CommandError.html#variant.SlotNotProgrammed
- /// [`WrongSlot`]: enum.CommandError.html#variant.WrongSlot
fn get_hotp_code(&self, slot: u8) -> Result<String, CommandError> {
unsafe {
let temp_password_ptr = self.temp_password.as_ptr() as *const i8;
@@ -623,40 +593,6 @@ impl<T: Device> GenerateOtp for User<T> {
}
}
- /// 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.
- ///
- /// # Errors
- ///
- /// - [`SlotNotProgrammed`][] if the given slot is not configured
- /// - [`WrongSlot`][] if there is no slot with the given number
- ///
- /// # Example
- ///
- /// ```no_run
- /// use nitrokey::{Authenticate, GenerateOtp};
- /// # use nitrokey::CommandError;
- ///
- /// # fn try_main() -> Result<(), CommandError> {
- /// let device = nitrokey::connect()?;
- /// match device.authenticate_user("123456") {
- /// Ok(user) => {
- /// let code = user.get_totp_code(1)?;
- /// println!("Generated TOTP code on slot 1: {:?}", code);
- /// },
- /// Err(err) => println!("Could not authenticate: {:?}", err),
- /// };
- /// # Ok(())
- /// # }
- /// ```
- ///
- /// [`get_config`]: trait.Device.html#method.get_config
- /// [`set_time`]: trait.Device.html#method.set_time
- /// [`SlotNotProgrammed`]: enum.CommandError.html#variant.SlotNotProgrammed
- /// [`WrongSlot`]: enum.CommandError.html#variant.WrongSlot
fn get_totp_code(&self, slot: u8) -> Result<String, CommandError> {
unsafe {
let temp_password_ptr = self.temp_password.as_ptr() as *const i8;