mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-13 09:11:51 +00:00
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:
parent
1927c2e1d8
commit
e16c76e3c3
180 changed files with 487 additions and 501 deletions
|
|
@ -74,12 +74,12 @@ impl ModDir {
|
|||
candidate_files.push(self.dir_path.join_attr(attr_path, self.root_non_dir_owner))
|
||||
}
|
||||
None if file_id.is_include_macro(db.upcast()) => {
|
||||
candidate_files.push(format!("{}.rs", name));
|
||||
candidate_files.push(format!("{}/mod.rs", name));
|
||||
candidate_files.push(format!("{name}.rs"));
|
||||
candidate_files.push(format!("{name}/mod.rs"));
|
||||
}
|
||||
None => {
|
||||
candidate_files.push(format!("{}{}.rs", self.dir_path.0, name));
|
||||
candidate_files.push(format!("{}{}/mod.rs", self.dir_path.0, name));
|
||||
candidate_files.push(format!("{}{name}.rs", self.dir_path.0));
|
||||
candidate_files.push(format!("{}{name}/mod.rs", self.dir_path.0));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ impl ModDir {
|
|||
let (dir_path, root_non_dir_owner) = if is_mod_rs || attr_path.is_some() {
|
||||
(DirPath::empty(), false)
|
||||
} else {
|
||||
(DirPath::new(format!("{}/", name)), true)
|
||||
(DirPath::new(format!("{name}/")), true)
|
||||
};
|
||||
if let Some(mod_dir) = self.child(dir_path, root_non_dir_owner) {
|
||||
return Ok((file_id, is_mod_rs, mod_dir));
|
||||
|
|
@ -156,7 +156,7 @@ impl DirPath {
|
|||
} else {
|
||||
attr
|
||||
};
|
||||
let res = format!("{}{}", base, attr);
|
||||
let res = format!("{base}{attr}");
|
||||
res
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue