changeset 4:051fea58a3c5

Update to Rust 2018 and remove warnings
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 12 Oct 2019 13:21:09 +0200
parents 09cdb220b85c
children 0138438fae34
files Cargo.toml src/lib.rs
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Cargo.toml	Sun Sep 03 11:56:12 2017 +0200
+++ b/Cargo.toml	Sat Oct 12 13:21:09 2019 +0200
@@ -6,6 +6,7 @@
 description = "Measure how long your test cases take with one simple macro."
 repository = "https://bitbucket.org/dermesser/time_test"
 documentation = "https://docs.rs/time-test"
+edition = "2018"
 
 [dependencies]
 time = "0.1"
--- a/src/lib.rs	Sun Sep 03 11:56:12 2017 +0200
+++ b/src/lib.rs	Sat Oct 12 13:21:09 2019 +0200
@@ -41,7 +41,7 @@
 
 use std::io::{self, Write};
 
-extern crate time;
+use time;
 
 /// TestTimer allows to easily time tests. It's recommended to use the time_test!() macro instead
 /// of invoking this type directly.
@@ -57,9 +57,9 @@
     fn drop(&mut self) {
         let dur = time::get_time() - self.0;
         if self.1.is_empty() {
-            write!(io::stderr(), "(took {}) ", dur).is_ok();
+            write!(io::stderr(), "(took {}) ", dur).unwrap_or(());
         } else {
-            write!(io::stderr(), "({} took {}) ", self.1, dur).is_ok();
+            write!(io::stderr(), "({} took {}) ", self.1, dur).unwrap_or(());
         }
     }
 }