Fix precision handling in ClockTime Display impl

This commit is contained in:
Sebastian Dröge 2017-12-10 12:31:41 +02:00
parent 580fc603e0
commit 298cb754c9

View file

@ -87,7 +87,7 @@ impl fmt::Display for ClockTime {
f.write_fmt(format_args!("{:02}:{:02}:{:02}", h, m, s))
} else {
let mut divisor = 1;
let precision = cmp::max(precision, 9);
let precision = cmp::min(precision, 9);
for _ in 0..(9 - precision) {
divisor *= 10;
}