diff options
author | Aleksey Kladov <[email protected]> | 2018-12-05 10:20:11 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-05 10:20:11 +0000 |
commit | db456749a85e87cdbe3f87b85bf44446d9d5694b (patch) | |
tree | 615c68873a325a02be8e21e1bd4dcb9ce8ab6a1e /crates/ra_hir/src/module | |
parent | 4344264024d374bb9cdc6f388f13c90b48c6c22e (diff) |
make stuff private
Diffstat (limited to 'crates/ra_hir/src/module')
-rw-r--r-- | crates/ra_hir/src/module/mod.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/crates/ra_hir/src/module/mod.rs b/crates/ra_hir/src/module/mod.rs index 9ab7dbff5..580c737c3 100644 --- a/crates/ra_hir/src/module/mod.rs +++ b/crates/ra_hir/src/module/mod.rs | |||
@@ -153,17 +153,10 @@ impl ModuleTree { | |||
153 | self.mods.iter().map(|(id, _)| id) | 153 | self.mods.iter().map(|(id, _)| id) |
154 | } | 154 | } |
155 | 155 | ||
156 | fn modules_for_source(&self, source: ModuleSource) -> Vec<ModuleId> { | 156 | pub(crate) fn modules_with_sources<'a>( |
157 | self.mods | 157 | &'a self, |
158 | .iter() | 158 | ) -> impl Iterator<Item = (ModuleId, ModuleSource)> + 'a { |
159 | .filter(|(_idx, it)| it.source == source) | 159 | self.mods.iter().map(|(id, m)| (id, m.source)) |
160 | .map(|(idx, _)| idx) | ||
161 | .collect() | ||
162 | } | ||
163 | |||
164 | //TODO: move to source binders? | ||
165 | pub(crate) fn any_module_for_source(&self, source: ModuleSource) -> Option<ModuleId> { | ||
166 | self.modules_for_source(source).pop() | ||
167 | } | 160 | } |
168 | } | 161 | } |
169 | 162 | ||