From 5c8cb56506646637e45a646657baf12fa9a8f49a Mon Sep 17 00:00:00 2001 From: gfreezy Date: Wed, 16 Jan 2019 21:39:01 +0800 Subject: move rename to a new mod --- crates/ra_hir/src/source_binder.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir/src') 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( let parent_module = module_from_file_id(db, file_id); let child_name = decl.name(); match (parent_module, child_name) { - (Some(parent_module), Some(child_name)) => { - if let Some(child) = parent_module.child(db, &child_name.as_name()) { - return Some(child); - } - } - _ => (), + (Some(parent_module), Some(child_name)) => parent_module.child(db, &child_name.as_name()), + _ => None, } - None } /// Locates the module by position in the source code. -- cgit v1.2.3