Skip to content

Commit

Permalink
misc: make use of proper space before units
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaDve committed Feb 11, 2024
1 parent 033a878 commit 41cebfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/format_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ pub fn duration(clock_time: gst::ClockTime) -> String {
let seconds_display = secs % 60;

let hours_display_str = ngettext_f(
"{time} hour",
"{time} hours",
"{time}hour",
"{time}hours",
hours_display as u32,
&[("time", &hours_display.to_string())],
);
let minutes_display_str = ngettext_f(
"{time} minute",
"{time} minutes",
"{time}minute",
"{time}minutes",
minutes_display as u32,
&[("time", &minutes_display.to_string())],
);
let seconds_display_str = ngettext_f(
"{time} second",
"{time} seconds",
"{time}second",
"{time}seconds",
seconds_display as u32,
&[("time", &seconds_display.to_string())],
);
Expand All @@ -57,19 +57,19 @@ mod tests {

#[test]
fn test_duration() {
assert_eq!(duration(gst::ClockTime::ZERO), "0 seconds");
assert_eq!(duration(gst::ClockTime::from_seconds(1)), "1 second");
assert_eq!(duration(gst::ClockTime::ZERO), "0seconds");
assert_eq!(duration(gst::ClockTime::from_seconds(1)), "1second");
assert_eq!(
duration(gst::ClockTime::from_seconds(3 * 60 + 4)),
"3 minutes 4 seconds"
"3minutes 4seconds"
);
assert_eq!(
duration(gst::ClockTime::from_seconds(60 * 60 + 6)),
"1 hour 0 minutes 6 seconds"
"1hour 0minutes 6seconds"
);
assert_eq!(
duration(gst::ClockTime::from_seconds(2 * 60 * 60)),
"2 hours 0 minutes 0 seconds"
"2hours 0minutes 0seconds"
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ impl Window {
let fps_text = settings.video_framerate().to_string();

imp.title
.set_subtitle(&format!("{} • {} FPS", profile_text, fps_text));
.set_subtitle(&format!("{} • {}FPS", profile_text, fps_text));
}

fn update_audio_toggles_sensitivity(&self) {
Expand Down

0 comments on commit 41cebfc

Please sign in to comment.