Clean format strings

main
Elnu 1 year ago
parent 6576e2f3f9
commit 4bad0eef9b

@ -28,16 +28,16 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let file_contents = match std::fs::read_to_string(&args.config_file) { let file_contents = match std::fs::read_to_string(&args.config_file) {
Ok(val) => val, Ok(val) => val,
Err(e) => { Err(e) => {
error!("Could not read config file: {}", e.to_string()); error!("Could not read config file: {e}");
panic!("{}", e); panic!("{e}");
} }
}; };
let cfg: Config = match toml::from_str(file_contents.as_str()) { let cfg: Config = match toml::from_str(file_contents.as_str()) {
Ok(val) => val, Ok(val) => val,
Err(e) => { Err(e) => {
error!("Could not parse config file: {}", e.to_string()); error!("Could not parse config file: {e}");
panic!("{}", e); panic!("{e}");
} }
}; };
@ -58,8 +58,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
} }
} }
Err(e) => { Err(e) => {
error!("Error opening /dev/: {}", e.to_string()); error!("Error opening /dev/: {e}");
panic!("{}", e); panic!("{e}");
} }
}; };
@ -74,8 +74,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
{ {
Ok(val) => String::from_utf8_lossy(&val.stdout).into_owned(), Ok(val) => String::from_utf8_lossy(&val.stdout).into_owned(),
Err(e) => { Err(e) => {
warn!("Error running hddtemp: {}", e.to_string()); warn!("Error running hddtemp: {e}");
warn!("Drive was: '{}'", drive); warn!("Drive was: '{drive}'");
"".to_string() "".to_string()
} }
}; };

Loading…
Cancel
Save