From f1b134f51254e82f352a06aae9557cc4570627de Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 21 Nov 2022 15:39:03 +0100 Subject: Use f-strings when convenient --- src/util/event.rs | 4 ++-- src/util/time.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/util') diff --git a/src/util/event.rs b/src/util/event.rs index 05d8581..379df99 100644 --- a/src/util/event.rs +++ b/src/util/event.rs @@ -45,7 +45,7 @@ impl Events { let stdin = io::stdin(); for key in stdin.keys().flatten() { if let Err(err) = tx.send(Event::Input(key)) { - eprintln!("{}", err); + eprintln!("{err}"); return; } } @@ -54,7 +54,7 @@ impl Events { let tick_handle = { thread::spawn(move || loop { if let Err(err) = tx.send(Event::Tick) { - eprintln!("{}", err); + eprintln!("{err}"); break; } thread::sleep(config.tick_rate); diff --git a/src/util/time.rs b/src/util/time.rs index b8a85e6..679d1b4 100644 --- a/src/util/time.rs +++ b/src/util/time.rs @@ -31,9 +31,9 @@ pub fn pp_duration(seconds: u64) -> String { fn plural(n: u64, str: &str) -> String { if n <= 1 { - format!("{} {}", n, str) + format!("{n} {str}") } else { - format!("{} {}s", n, str) + format!("{n} {str}s") } } -- cgit v1.2.3