Resolve uninlined_format_args clippy warnings

The upcomming release of Rust 1.67.0 will warn on `uninlined_format_args`.
This PR resolves that by inlining all these items.
It also looks nicer.
This commit is contained in:
BlackDex
2022-12-29 14:11:52 +01:00
committed by Mathijs van Veluw
parent 988d24927e
commit d30878c4ea
16 changed files with 55 additions and 55 deletions

View File

@ -135,11 +135,11 @@ fn parse_args() {
let version = VERSION.unwrap_or("(Version info from Git not present)");
if pargs.contains(["-h", "--help"]) {
println!("vaultwarden {}", version);
print!("{}", HELP);
println!("vaultwarden {version}");
print!("{HELP}");
exit(0);
} else if pargs.contains(["-v", "--version"]) {
println!("vaultwarden {}", version);
println!("vaultwarden {version}");
exit(0);
}
}
@ -149,7 +149,7 @@ fn launch_info() {
println!("| Starting Vaultwarden |");
if let Some(version) = VERSION {
println!("|{:^68}|", format!("Version {}", version));
println!("|{:^68}|", format!("Version {version}"));
}
println!("|--------------------------------------------------------------------|");
@ -224,7 +224,7 @@ fn init_logging(level: log::LevelFilter) -> Result<(), fern::InitError> {
))
});
} else {
logger = logger.format(|out, message, _| out.finish(format_args!("{}", message)));
logger = logger.format(|out, message, _| out.finish(format_args!("{message}")));
}
if let Some(log_file) = CONFIG.log_file() {
@ -299,7 +299,7 @@ fn chain_syslog(logger: fern::Dispatch) -> fern::Dispatch {
fn create_dir(path: &str, description: &str) {
// Try to create the specified dir, if it doesn't already exist.
let err_msg = format!("Error creating {} directory '{}'", description, path);
let err_msg = format!("Error creating {description} directory '{path}'");
create_dir_all(path).expect(&err_msg);
}