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

@ -411,16 +411,16 @@ where
use std::env;
pub fn get_env_str_value(key: &str) -> Option<String> {
let key_file = format!("{}_FILE", key);
let key_file = format!("{key}_FILE");
let value_from_env = env::var(key);
let value_file = env::var(&key_file);
match (value_from_env, value_file) {
(Ok(_), Ok(_)) => panic!("You should not define both {} and {}!", key, key_file),
(Ok(_), Ok(_)) => panic!("You should not define both {key} and {key_file}!"),
(Ok(v_env), Err(_)) => Some(v_env),
(Err(_), Ok(v_file)) => match fs::read_to_string(v_file) {
Ok(content) => Some(content.trim().to_string()),
Err(e) => panic!("Failed to load {}: {:?}", key, e),
Err(e) => panic!("Failed to load {key}: {e:?}"),
},
_ => None,
}