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:
@@ -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)");
|
||||
|
||||
@@ -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
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user