Use variables directly inside format strings

Most systems should have an up to date Rust compiler by now, so we should be
fine.
This commit is contained in:
Henrik Friedrichsen
2023-02-06 20:06:25 +01:00
parent 2fe3b056bf
commit 8222f1b2e4
17 changed files with 34 additions and 40 deletions

View File

@@ -218,7 +218,7 @@ impl View for Layout {
// back button + title
if !self.is_current_stack_empty() {
printer.with_color(ColorStyle::title_secondary(), |printer| {
printer.print((1, 0), &format!("< {}", screen_title));
printer.print((1, 0), &format!("< {screen_title}"));
});
}
@@ -255,10 +255,7 @@ impl View for Layout {
printer.with_color(style, |printer| {
printer.print_hline((0, printer.size.y - cmdline_height), printer.size.x, " ");
printer.print(
(0, printer.size.y - cmdline_height),
&format!("ERROR: {}", e),
);
printer.print((0, printer.size.y - cmdline_height), &format!("ERROR: {e}"));
});
}

View File

@@ -83,7 +83,7 @@ impl ViewWrapper for LibraryView {
impl ViewExt for LibraryView {
fn title(&self) -> String {
if let Some(name) = &self.display_name {
format!("Library of {}", name)
format!("Library of {name}")
} else {
"Library".to_string()
}