Support the rustc in the latest Ubuntu LTS.

At this time, this is Bionic, with Rust 1.25.0.
This commit is contained in:
Dan Gohman
2018-07-13 16:19:48 -07:00
parent 202e45c213
commit 2db2d946b8
5 changed files with 20 additions and 12 deletions

View File

@@ -154,7 +154,8 @@ mod details {
fn fmtdur(mut dur: Duration, f: &mut fmt::Formatter) -> fmt::Result {
// Round to nearest ms by adding 500us.
dur += Duration::new(0, 500_000);
write!(f, "{:4}.{:03} ", dur.as_secs(), dur.subsec_millis())
let ms = dur.subsec_nanos() / 1_000_000;
write!(f, "{:4}.{:03} ", dur.as_secs(), ms)
}
fmtdur(time.total, f)?;