From 7aacf9a19739f53a45840df2d08b5f3cca761192 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 8 Dec 2019 12:20:59 +0100 Subject: Drop some unused methods --- crates/ra_hir/src/from_source.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/from_source.rs') diff --git a/crates/ra_hir/src/from_source.rs b/crates/ra_hir/src/from_source.rs index 071ca2e5a..307f3d5bf 100644 --- a/crates/ra_hir/src/from_source.rs +++ b/crates/ra_hir/src/from_source.rs @@ -216,8 +216,10 @@ impl Module { } }?; - let child_name = src.value.name()?; - parent_module.child(db, &child_name.as_name()) + let child_name = src.value.name()?.as_name(); + let def_map = db.crate_def_map(parent_module.id.krate); + let child_id = def_map[parent_module.id.local_id].children.get(&child_name)?; + Some(parent_module.with_module_id(*child_id)) } pub fn from_definition(db: &impl DefDatabase, src: InFile) -> Option { -- cgit v1.2.3