Fix some clippy warnings (#536)

This commit is contained in:
Marcin Mielniczuk
2019-11-10 22:50:19 +01:00
committed by Dan Gohman
parent ef1cbfdaa8
commit 3206461502
6 changed files with 16 additions and 13 deletions

View File

@@ -39,11 +39,13 @@ lazy_static! {
.map_err(|_| warn!("Failed to get metadata of current executable"))
.ok()
})
.map(|mtime| match mtime.duration_since(std::time::UNIX_EPOCH) {
Ok(duration) => format!("{}", duration.as_millis()),
Err(err) => format!("m{}", err.duration().as_millis()),
})
.unwrap_or_else(|| "no-mtime".to_string())
.map_or_else(
|| "no-mtime".to_string(),
|mtime| match mtime.duration_since(std::time::UNIX_EPOCH) {
Ok(duration) => format!("{}", duration.as_millis()),
Err(err) => format!("m{}", err.duration().as_millis()),
},
)
};
}

View File

@@ -9,7 +9,7 @@
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
#![cfg_attr(
feature = "cargo-clippy",
allow(clippy::new_without_default, clippy::new_without_default_derive)
allow(clippy::new_without_default, clippy::new_without_default)
)]
#![cfg_attr(
feature = "cargo-clippy",