don't fill extra zeros before the minute number

This commit is contained in:
figsoda 2020-11-03 07:36:42 -05:00
parent 9adbe3be1b
commit c077953b88

View file

@ -234,17 +234,17 @@ fn flatten(
Texts::CurrentElapsed => { Texts::CurrentElapsed => {
if let Some(Song { elapsed, .. }) = status.song { if let Some(Song { elapsed, .. }) = status.song {
spans.push(Span::styled( spans.push(Span::styled(
format!("{:02}:{:02}", elapsed / 60, elapsed % 60), format!("{}:{:02}", elapsed / 60, elapsed % 60),
style, style,
)) ));
} }
} }
Texts::CurrentDuration => { Texts::CurrentDuration => {
if let Some(Track { time, .. }) = current_track { if let Some(Track { time, .. }) = current_track {
spans.push(Span::styled( spans.push(Span::styled(
format!("{:02}:{:02}", time / 60, time % 60), format!("{}:{:02}", time / 60, time % 60),
style, style,
)) ));
} }
} }
Texts::CurrentFile => { Texts::CurrentFile => {
@ -280,9 +280,9 @@ fn flatten(
Texts::QueueDuration => { Texts::QueueDuration => {
if let Some(Track { time, .. }) = queue_track { if let Some(Track { time, .. }) = queue_track {
spans.push(Span::styled( spans.push(Span::styled(
format!("{:02}:{:02}", time / 60, time % 60), format!("{}:{:02}", time / 60, time % 60),
style, style,
)) ));
} }
} }
Texts::QueueFile => { Texts::QueueFile => {