From ed023929d5f3a53a3989371452291176d3ce543c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 26 Nov 2018 00:46:13 +0300 Subject: Switch to id-arena --- crates/ra_analysis/src/descriptors/module/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_analysis/src/descriptors/module/mod.rs') 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 { impl ModuleTree { fn modules<'a>(&'a self) -> impl Iterator + 'a { - self.mods.keys() + self.mods.iter().map(|(id, _)| id) } fn modules_for_source(&self, source: ModuleSource) -> Vec { self.mods - .items() + .iter() .filter(|(_idx, it)| it.source == source) .map(|(idx, _)| idx) .collect() @@ -333,11 +333,11 @@ struct LinkData { impl ModuleTree { fn push_mod(&mut self, data: ModuleData) -> ModuleId { - self.mods.push(data) + self.mods.alloc(data) } fn push_link(&mut self, data: LinkData) -> LinkId { let owner = data.owner; - let id = self.links.push(data); + let id = self.links.alloc(data); self.mods[owner].children.push(id); id } -- cgit v1.2.3