aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model_impl
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-04-10 08:12:54 +0100
committerAleksey Kladov <[email protected]>2019-04-10 08:12:54 +0100
commit1cd184d6539478c7e54c92835902921976dce5d1 (patch)
tree3b6e19f4556f85c2875ae3e6376f35fe3f34d17a /crates/ra_hir/src/code_model_impl
parentb863272899a1bae63c7d9411d0ebff74652bae8e (diff)
use either for uses
Diffstat (limited to 'crates/ra_hir/src/code_model_impl')
-rw-r--r--crates/ra_hir/src/code_model_impl/module.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/crates/ra_hir/src/code_model_impl/module.rs b/crates/ra_hir/src/code_model_impl/module.rs
index 88dee3a69..5c2ea73ce 100644
--- a/crates/ra_hir/src/code_model_impl/module.rs
+++ b/crates/ra_hir/src/code_model_impl/module.rs
@@ -3,9 +3,9 @@ use ra_syntax::{ast, TreeArc};
3 3
4use crate::{ 4use crate::{
5 Module, ModuleSource, Name, AstId, 5 Module, ModuleSource, Name, AstId,
6 nameres::{CrateModuleId, ImportId}, 6 nameres::CrateModuleId,
7 HirDatabase, DefDatabase, 7 HirDatabase, DefDatabase,
8 HirFileId, ImportSource, 8 HirFileId,
9}; 9};
10 10
11impl ModuleSource { 11impl ModuleSource {
@@ -68,16 +68,6 @@ impl Module {
68 Some((decl.file_id(), ast)) 68 Some((decl.file_id(), ast))
69 } 69 }
70 70
71 pub(crate) fn import_source_impl(
72 &self,
73 db: &impl HirDatabase,
74 import: ImportId,
75 ) -> ImportSource {
76 let (file_id, source) = self.definition_source(db);
77 let (_, source_map) = db.raw_items_with_source_map(file_id);
78 source_map.get(&source, import)
79 }
80
81 pub(crate) fn crate_root_impl(&self, db: &impl DefDatabase) -> Module { 71 pub(crate) fn crate_root_impl(&self, db: &impl DefDatabase) -> Module {
82 let def_map = db.crate_def_map(self.krate); 72 let def_map = db.crate_def_map(self.krate);
83 self.with_module_id(def_map.root()) 73 self.with_module_id(def_map.root())