diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-27 11:23:29 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-11-27 11:23:29 +0000 |
commit | 8e37208040a456d4e481472f69b3b584655ee90f (patch) | |
tree | d7c7674e657443a104cc06a24c1254e8396ca286 /crates/ra_analysis/src/descriptors/module | |
parent | 7adbea9c425847ee7193d3eaba2bef5ba4f0d4bd (diff) | |
parent | ed023929d5f3a53a3989371452291176d3ce543c (diff) |
Merge #244
244: Switch to id-arena r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module')
-rw-r--r-- | crates/ra_analysis/src/descriptors/module/mod.rs | 8 |
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 | ||
167 | impl ModuleTree { | 167 | impl 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 | ||
334 | impl ModuleTree { | 334 | impl 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 | } |