mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-05 15:06:16 +00:00
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, " ")?;
|
write!(f, " ")?;
|
||||||
}
|
}
|
||||||
first = false;
|
first = false;
|
||||||
write!(f, "{}{}", v, unit)
|
write!(f, "{v}{unit}")
|
||||||
};
|
};
|
||||||
if self.years > 0 {
|
if self.years > 0 {
|
||||||
do_write(self.years, "y")?;
|
do_write(self.years, "y")?;
|
||||||
@ -176,9 +176,9 @@ impl std::fmt::Display for TimeSpan {
|
|||||||
write!(f, " ")?;
|
write!(f, " ")?;
|
||||||
}
|
}
|
||||||
if seconds >= 1.0 || !first {
|
if seconds >= 1.0 || !first {
|
||||||
write!(f, "{:.0}s", seconds)?;
|
write!(f, "{seconds:.0}s")?;
|
||||||
} else {
|
} else {
|
||||||
write!(f, "{:.1}s", seconds)?;
|
write!(f, "{seconds:.1}s")?;
|
||||||
}
|
}
|
||||||
} else if first {
|
} else if first {
|
||||||
write!(f, "<0.1s")?;
|
write!(f, "<0.1s")?;
|
||||||
|
Loading…
Reference in New Issue
Block a user