diff options
author | Aleksey Kladov <[email protected]> | 2019-04-10 08:12:54 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-04-10 08:12:54 +0100 |
commit | 1cd184d6539478c7e54c92835902921976dce5d1 (patch) | |
tree | 3b6e19f4556f85c2875ae3e6376f35fe3f34d17a /crates/ra_hir/src/code_model_impl | |
parent | b863272899a1bae63c7d9411d0ebff74652bae8e (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.rs | 14 |
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 | ||
4 | use crate::{ | 4 | use 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 | ||
11 | impl ModuleSource { | 11 | impl 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()) |