Update to use newer Rust features.

This re-introduces several cleanups that we previously deferred for not
supporting Rust 1.25.
This commit is contained in:
Dan Gohman
2018-10-24 11:10:20 -07:00
parent 62e55f63e6
commit 9471c06da4
11 changed files with 14 additions and 33 deletions

View File

@@ -10,11 +10,7 @@
unstable_features
)]
#![warn(unused_import_braces)]
#![cfg_attr(feature = "cargo-clippy",
allow(
type_complexity,
// This requires Rust 1.27 or later.
duration_subsec))]
#![cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
#![cfg_attr(
feature = "cargo-clippy",
warn(

View File

@@ -47,13 +47,7 @@ impl Display for QueueEntry {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let p = self.path.to_string_lossy();
match self.state {
State::Done(Ok(dur)) => write!(
f,
"{}.{:03} {}",
dur.as_secs(),
dur.subsec_nanos() / 1_000_000,
p
),
State::Done(Ok(dur)) => write!(f, "{}.{:03} {}", dur.as_secs(), dur.subsec_millis(), p),
State::Done(Err(ref e)) => write!(f, "FAIL {}: {}", p, e),
_ => write!(f, "{}", p),
}