1
0
mirror of https://github.com/sharkdp/bat synced 2026-07-28 17:51:44 +00:00

Inline format! args wherever possible

This commit is contained in:
Lena
2024-02-24 22:36:14 +01:00
committed by Martin Nordholts
parent 487bed2d95
commit 4c85483486
17 changed files with 35 additions and 40 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ pub fn assets_from_cache_or_binary(
}
fn clear_asset(path: PathBuf, description: &str) {
print!("Clearing {} ... ", description);
print!("Clearing {description} ... ");
match fs::remove_file(&path) {
Err(err) if err.kind() == io::ErrorKind::NotFound => {
println!("skipped (not present)");
+1 -1
View File
@@ -430,7 +430,7 @@ pub fn build_app(interactive_output: bool) -> Command {
});
if let Some(invalid) = invalid_vals.next() {
Err(format!("Unknown style, '{}'", invalid))
Err(format!("Unknown style, '{invalid}'"))
} else {
Ok(val.to_owned())
}
+2 -5
View File
@@ -222,7 +222,7 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result<
)?;
} else {
for theme in assets.themes() {
writeln!(stdout, "{}", theme)?;
writeln!(stdout, "{theme}")?;
}
}
@@ -232,10 +232,7 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result<
fn set_terminal_title_to(new_terminal_title: String) {
let osc_command_for_setting_terminal_title = "\x1b]0;";
let osc_end_command = "\x07";
print!(
"{}{}{}",
osc_command_for_setting_terminal_title, new_terminal_title, osc_end_command
);
print!("{osc_command_for_setting_terminal_title}{new_terminal_title}{osc_end_command}");
io::stdout().flush().unwrap();
}