Pad output of `Display` on `Instant`

Zero-pad the milliseconds part of a displayed `Instant` to include
three leading zeros.
Closes: #297
Approved by: whitequark
This commit is contained in:
David Wood 2019-05-27 21:48:28 +01:00 committed by Homu
parent 4f4b209103
commit 67653fbf38
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ impl Duration {
impl fmt::Display for Duration {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}.{}s", self.secs(), self.millis())
write!(f, "{}.{:03}s", self.secs(), self.millis())
}
}