time: switch to inline template variables
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
67822186a2
commit
9ae91303fd
@ -149,7 +149,7 @@ impl std::fmt::Display for TimeSpan {
|
||||
write!(f, " ")?;
|
||||
}
|
||||
first = false;
|
||||
write!(f, "{}{}", v, unit)
|
||||
write!(f, "{v}{unit}")
|
||||
};
|
||||
if self.years > 0 {
|
||||
do_write(self.years, "y")?;
|
||||
@ -176,9 +176,9 @@ impl std::fmt::Display for TimeSpan {
|
||||
write!(f, " ")?;
|
||||
}
|
||||
if seconds >= 1.0 || !first {
|
||||
write!(f, "{:.0}s", seconds)?;
|
||||
write!(f, "{seconds:.0}s")?;
|
||||
} else {
|
||||
write!(f, "{:.1}s", seconds)?;
|
||||
write!(f, "{seconds:.1}s")?;
|
||||
}
|
||||
} else if first {
|
||||
write!(f, "<0.1s")?;
|
||||
|
Loading…
Reference in New Issue
Block a user