aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module')
-rw-r--r--crates/ra_analysis/src/descriptors/module/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs
index 54ff95b66..a6eaec178 100644
--- a/crates/ra_analysis/src/descriptors/module/mod.rs
+++ b/crates/ra_analysis/src/descriptors/module/mod.rs
@@ -166,12 +166,12 @@ pub(crate) struct ModuleTree {
166 166
167impl ModuleTree { 167impl ModuleTree {
168 fn modules<'a>(&'a self) -> impl Iterator<Item = ModuleId> + 'a { 168 fn modules<'a>(&'a self) -> impl Iterator<Item = ModuleId> + 'a {
169 self.mods.keys() 169 self.mods.iter().map(|(id, _)| id)
170 } 170 }
171 171
172 fn modules_for_source(&self, source: ModuleSource) -> Vec<ModuleId> { 172 fn modules_for_source(&self, source: ModuleSource) -> Vec<ModuleId> {
173 self.mods 173 self.mods
174 .items() 174 .iter()
175 .filter(|(_idx, it)| it.source == source) 175 .filter(|(_idx, it)| it.source == source)
176 .map(|(idx, _)| idx) 176 .map(|(idx, _)| idx)
177 .collect() 177 .collect()
@@ -333,11 +333,11 @@ struct LinkData {
333 333
334impl ModuleTree { 334impl ModuleTree {
335 fn push_mod(&mut self, data: ModuleData) -> ModuleId { 335 fn push_mod(&mut self, data: ModuleData) -> ModuleId {
336 self.mods.push(data) 336 self.mods.alloc(data)
337 } 337 }
338 fn push_link(&mut self, data: LinkData) -> LinkId { 338 fn push_link(&mut self, data: LinkData) -> LinkId {
339 let owner = data.owner; 339 let owner = data.owner;
340 let id = self.links.push(data); 340 let id = self.links.alloc(data);
341 self.mods[owner].children.push(id); 341 self.mods[owner].children.push(id);
342 id 342 id
343 } 343 }