Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_diagnostics/src/handlers/unlinked_file.rs')
| -rw-r--r-- | crates/ide_diagnostics/src/handlers/unlinked_file.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ide_diagnostics/src/handlers/unlinked_file.rs b/crates/ide_diagnostics/src/handlers/unlinked_file.rs index cc10a63f87..5ea58b74fe 100644 --- a/crates/ide_diagnostics/src/handlers/unlinked_file.rs +++ b/crates/ide_diagnostics/src/handlers/unlinked_file.rs @@ -45,16 +45,14 @@ fn fixes(ctx: &DiagnosticsContext, file_id: FileId) -> Option<Vec<Assist>> { // - `$dir.rs` in the parent folder, where `$dir` is the directory containing `self.file_id` let parent = our_path.parent()?; let paths = { - let temp; let parent = if module_name == "mod" { // for mod.rs we need to actually look up one higher // and take the parent as our to be module name let (name, _) = parent.name_and_extension()?; module_name = name; - temp = parent.parent()?; - &temp + parent.parent()? } else { - &parent + parent }; let mut paths = vec![parent.join("mod.rs")?, parent.join("lib.rs")?, parent.join("main.rs")?]; |