1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

chore: manual inline formatting

Minor manual cleanup - inlined many format args.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.  Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
This commit is contained in:
Yuri Astrakhan 2025-04-07 22:56:21 -04:00
parent b7bf8c9467
commit 982805d3cd
29 changed files with 133 additions and 183 deletions

View file

@ -585,11 +585,7 @@ fn test_du_h_precision() {
.arg("--apparent-size")
.arg(&fpath)
.succeeds()
.stdout_only(format!(
"{}\t{}\n",
expected_output,
&fpath.to_string_lossy()
));
.stdout_only(format!("{expected_output}\t{}\n", fpath.to_string_lossy()));
}
}
@ -659,7 +655,7 @@ fn birth_supported() -> bool {
let ts = TestScenario::new(util_name!());
let m = match std::fs::metadata(&ts.fixtures.subdir) {
Ok(m) => m,
Err(e) => panic!("{}", e),
Err(e) => panic!("{e}"),
};
m.created().is_ok()
}