Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres/mod_resolution.rs')
-rw-r--r--crates/hir-def/src/nameres/mod_resolution.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir-def/src/nameres/mod_resolution.rs b/crates/hir-def/src/nameres/mod_resolution.rs
index ca7bcc814e..4c263846d2 100644
--- a/crates/hir-def/src/nameres/mod_resolution.rs
+++ b/crates/hir-def/src/nameres/mod_resolution.rs
@@ -34,7 +34,7 @@ impl ModDir {
let path = match attr_path.map(SmolStr::as_str) {
None => {
let mut path = self.dir_path.clone();
- path.push(&name.to_smol_str());
+ path.push(&name.unescaped().to_smol_str());
path
}
Some(attr_path) => {
@@ -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
}
}