Skip to content

Commit 93ee09b

Browse files
committed
Use implicit named arguments in format! macro
1 parent 53a82f7 commit 93ee09b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/cargo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub fn exec_cargo_run(
9494
eprintln!("{}", cmd_str(&cmd));
9595

9696
cmd.spawn()
97-
.unwrap_or_else(|_| panic!("failed to spawn cargo {} command", action))
97+
.unwrap_or_else(|_| panic!("failed to spawn cargo {action} command"))
9898
.wait()
9999
.unwrap()
100100
}
@@ -106,7 +106,7 @@ fn cmd_str(cmd: &Command) -> String {
106106
.map(|a| {
107107
let a = a.to_string_lossy();
108108
if a.contains(char::is_whitespace) {
109-
format!("\"{}\"", a).into()
109+
format!("\"{a}\"").into()
110110
} else {
111111
a
112112
}

src/tui.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@ impl Tui {
267267

268268
let mut spans = Vec::new();
269269
spans.push(" ".into());
270-
spans.push(format!("{:kind_w$}", kind).fg(self.theme.kind_fg));
270+
spans.push(format!("{kind:kind_w$}").fg(self.theme.kind_fg));
271271
spans.push(" ".into());
272272
spans.extend(name_spans);
273273
spans.push(" ".into());
274-
spans.push(format!("{:path_w$}", path).fg(self.theme.path_fg));
274+
spans.push(format!("{path:path_w$}").fg(self.theme.path_fg));
275275
spans.push(" ".into());
276-
spans.push(format!("{:features_w$}", features).fg(self.theme.features_fg));
276+
spans.push(format!("{features:features_w$}").fg(self.theme.features_fg));
277277
spans.push(" ".into());
278278

279279
let line = Text::from(Line::from(spans));

0 commit comments

Comments
 (0)