aboutsummaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-12-27 23:08:29 +0100
committerRobin Krahl <robin.krahl@ireas.org>2019-12-27 23:08:29 +0100
commit4467ce7a2d1eedb320e92e5a26f1b93bc41d3611 (patch)
tree6eff6a4a13d6bed240b021c9c6c8fae45b9a957e /src/device
parentc35a20f6c034e4d8aa1eeba3eef85429e09d95dc (diff)
downloadnitrokey-rs-4467ce7a2d1eedb320e92e5a26f1b93bc41d3611.tar.gz
nitrokey-rs-4467ce7a2d1eedb320e92e5a26f1b93bc41d3611.tar.bz2
Simplify doc tests with results
Since Rust 1.34.0, we no longer need a `fn main` comment in doc tests that return results. It is sufficient to have an `Ok` return value with type annotations.
Diffstat (limited to 'src/device')
-rw-r--r--src/device/mod.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/device/mod.rs b/src/device/mod.rs
index af28ab5..5e15f08 100644
--- a/src/device/mod.rs
+++ b/src/device/mod.rs
@@ -78,13 +78,11 @@ pub trait Device<'a>: Authenticate<'a> + GetPasswordSafe<'a> + GenerateOtp + fmt
/// // ...
/// }
///
- /// # fn main() -> Result<(), nitrokey::Error> {
/// match nitrokey::take()?.connect() {
/// Ok(device) => do_something(device),
/// Err(err) => println!("Could not connect to a Nitrokey: {}", err),
/// }
- /// # Ok(())
- /// # }
+ /// # Ok::<(), nitrokey::Error>(())
/// ```
fn into_manager(self) -> &'a mut crate::Manager;