From cc746fa11cd74a77aa3dc20cade5ee1d574bf3b4 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Fri, 17 Sep 2021 15:11:22 +0900 Subject: [PATCH] Minor tweak to the remaining-time timer display --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 {