aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-04 17:21:20 +0000
committerAleksey Kladov <[email protected]>2018-11-05 09:36:38 +0000
commit88a15d10d543c09ef66a9f105c3dcdb5011abbee (patch)
tree773470eb035991ba0e137cc8b863179674d9b94f /crates/ra_analysis/src/descriptors/module
parentcd878658d3072ee0741cd04c16d330e7d5907f94 (diff)
use module_for_source
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module')
-rw-r--r--crates/ra_analysis/src/descriptors/module/mod.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs
index 4e871d16d..13bab0087 100644
--- a/crates/ra_analysis/src/descriptors/module/mod.rs
+++ b/crates/ra_analysis/src/descriptors/module/mod.rs
@@ -34,12 +34,8 @@ impl ModuleTree {
34 .collect() 34 .collect()
35 } 35 }
36 36
37 pub(crate) fn modules_for_file(&self, file_id: FileId) -> Vec<ModuleId> { 37 pub(crate) fn any_module_for_source(&self, source: ModuleSource) -> Option<ModuleId> {
38 self.modules_for_source(ModuleSource::File(file_id)) 38 self.modules_for_source(source).pop()
39 }
40
41 pub(crate) fn any_module_for_file(&self, file_id: FileId) -> Option<ModuleId> {
42 self.modules_for_file(file_id).pop()
43 } 39 }
44} 40}
45 41