aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorJoris2022-11-21 15:39:03 +0100
committerJoris2022-11-21 15:39:03 +0100
commitf1b134f51254e82f352a06aae9557cc4570627de (patch)
treee33fc88b3a601904059163a60d9b7b2f2b54dbe4 /src/util
parenta8422f43da46c010ec58666035ad0a6c2254c1ff (diff)
Use f-strings when convenient
Diffstat (limited to 'src/util')
-rw-r--r--src/util/event.rs4
-rw-r--r--src/util/time.rs4
2 files changed, 4 insertions, 4 deletions
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")
}
}