From: Stephen Seo Date: Fri, 17 Sep 2021 06:11:22 +0000 (+0900) Subject: Minor tweak to the remaining-time timer display X-Git-Tag: 0.1.0~17 X-Git-Url: https://git.seodisparate.com/tbm-client-edit-cmd.png?a=commitdiff_plain;h=cc746fa11cd74a77aa3dc20cade5ee1d574bf3b4;p=mpd_info_screen Minor tweak to the remaining-time timer display --- diff --git a/src/main.rs b/src/main.rs index a6c22a9..4da834d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -512,12 +512,12 @@ fn seconds_to_time(seconds: f64) -> String { if minutes > 0 { result = minutes.to_string(); result.push(':'); + if new_seconds < 10.0 { + result.push('0'); + } } else { result = String::new(); } - if new_seconds < 10.0 && seconds >= 0.0 { - result.push('0'); - } result.push_str(&new_seconds.to_string()); let idx_result = result.find('.'); if let Some(idx) = idx_result {