Inline all format arguments where possible

This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.

The change was automatically created with, so there are far less change
of an accidental typo.

```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
This commit is contained in:
Yuri Astrakhan 2022-12-23 13:42:58 -05:00
parent 1927c2e1d8
commit e16c76e3c3
180 changed files with 487 additions and 501 deletions

View file

@ -108,7 +108,7 @@ fn self_hosting_parsing() {
.into_iter()
.map(|(path, err)| format!("{}: {:?}\n", path.display(), err[0]))
.collect::<String>();
panic!("Parsing errors:\n{}\n", errors);
panic!("Parsing errors:\n{errors}\n");
}
}
@ -181,6 +181,6 @@ fn rust_files_in_dir(dir: &Path) -> Vec<PathBuf> {
/// so this should always be correct.
fn read_text(path: &Path) -> String {
fs::read_to_string(path)
.unwrap_or_else(|_| panic!("File at {:?} should be valid", path))
.unwrap_or_else(|_| panic!("File at {path:?} should be valid"))
.replace("\r\n", "\n")
}