aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/source_binder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r--crates/ra_hir/src/source_binder.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index 7ab8eeae2..be82d804a 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -35,14 +35,9 @@ pub fn module_from_declaration(
35 let parent_module = module_from_file_id(db, file_id); 35 let parent_module = module_from_file_id(db, file_id);
36 let child_name = decl.name(); 36 let child_name = decl.name();
37 match (parent_module, child_name) { 37 match (parent_module, child_name) {
38 (Some(parent_module), Some(child_name)) => { 38 (Some(parent_module), Some(child_name)) => parent_module.child(db, &child_name.as_name()),
39 if let Some(child) = parent_module.child(db, &child_name.as_name()) { 39 _ => None,
40 return Some(child);
41 }
42 }
43 _ => (),
44 } 40 }
45 None
46} 41}
47 42
48/// Locates the module by position in the source code. 43/// Locates the module by position in the source code.