aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-28 17:45:58 +0000
committerAleksey Kladov <[email protected]>2018-12-28 17:45:58 +0000
commit1a860dba38225a4d3e122eaf49c926479826becf (patch)
treec5d7a4e87cfdc20f552d8fd1b05259da8c1d9617 /crates
parent5299a35e3dc484ea2e7d42cfeed89aee806425d3 (diff)
simplify
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/module.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/crates/ra_hir/src/module.rs b/crates/ra_hir/src/module.rs
index 43413acb8..24c346984 100644
--- a/crates/ra_hir/src/module.rs
+++ b/crates/ra_hir/src/module.rs
@@ -13,8 +13,8 @@ use ra_db::{SourceRootId, FileId, Cancelable};
13use relative_path::RelativePathBuf; 13use relative_path::RelativePathBuf;
14 14
15use crate::{ 15use crate::{
16 DefKind, DefLoc, DefId, Path, PathKind, HirDatabase, SourceItemId, SourceFileItemId, Crate, 16 Def, DefKind, DefLoc, DefId,
17 Name, 17 Name, Path, PathKind, HirDatabase, SourceItemId, SourceFileItemId, Crate,
18 arena::{Arena, Id}, 18 arena::{Arena, Id},
19}; 19};
20 20
@@ -139,13 +139,8 @@ impl Module {
139 } else { 139 } else {
140 return Ok(PerNs::none()); 140 return Ok(PerNs::none());
141 }; 141 };
142 let module = match curr.loc(db) { 142 let module = match curr.resolve(db)? {
143 DefLoc { 143 Def::Module(it) => it,
144 kind: DefKind::Module,
145 source_root_id,
146 module_id,
147 ..
148 } => Module::new(db, source_root_id, module_id)?,
149 // TODO here would be the place to handle enum variants... 144 // TODO here would be the place to handle enum variants...
150 _ => return Ok(PerNs::none()), 145 _ => return Ok(PerNs::none()),
151 }; 146 };