From 4467ce7a2d1eedb320e92e5a26f1b93bc41d3611 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 27 Dec 2019 23:08:29 +0100 Subject: 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. --- src/device/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/device') 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; -- cgit v1.2.3