aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/from_source.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs
index 7756ca80e..9f7c22b21 100644
--- a/crates/ra_hir/src/from_source.rs
+++ b/crates/ra_hir/src/from_source.rs
@@ -262,12 +262,11 @@ impl Module {
262 262
263 let original_file = src.file_id.original_file(db); 263 let original_file = src.file_id.original_file(db);
264 264
265 let (krate, local_id) = 265 let (krate, local_id) = db.relevant_crates(original_file).iter().find_map(|&crate_id| {
266 db.relevant_crates(original_file).iter().find_map(|&crate_id| { 266 let crate_def_map = db.crate_def_map(crate_id);
267 let crate_def_map = db.crate_def_map(crate_id); 267 let local_id = crate_def_map.modules_for_file(original_file).next()?;
268 let local_id = crate_def_map.modules_for_file(original_file).next()?; 268 Some((crate_id, local_id))
269 Some((crate_id, local_id)) 269 })?;
270 })?;
271 Some(Module { id: ModuleId { krate, local_id } }) 270 Some(Module { id: ModuleId { krate, local_id } })
272 } 271 }
273} 272}