Skip to content

Commit cf2c713

Browse files
committed
Remove external scope from get_module_file
1 parent 476ddff commit cf2c713

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/racer/fileres.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,15 @@ pub fn get_crate_file(name: &str, from_path: &Path, session: &Session) -> Option
4040

4141
/// get module file from current path & crate name
4242
pub fn get_module_file(name: &str, parentdir: &Path, session: &Session) -> Option<PathBuf> {
43-
{
44-
// try just <name>.rs
45-
let filepath = parentdir.join(format!("{}.rs", name));
46-
if filepath.exists() || session.contains_file(&filepath) {
47-
return Some(filepath);
48-
}
43+
// try just <name>.rs
44+
let filepath = parentdir.join(format!("{}.rs", name));
45+
if filepath.exists() || session.contains_file(&filepath) {
46+
return Some(filepath);
4947
}
50-
{
51-
// try <name>/mod.rs
52-
let filepath = parentdir.join(name).join("mod.rs");
53-
if filepath.exists() || session.contains_file(&filepath) {
54-
return Some(filepath);
55-
}
48+
// try <name>/mod.rs
49+
let filepath = parentdir.join(name).join("mod.rs");
50+
if filepath.exists() || session.contains_file(&filepath) {
51+
return Some(filepath);
5652
}
5753
None
5854
}

0 commit comments

Comments
 (0)