aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module/imp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module/imp.rs')
-rw-r--r--crates/ra_analysis/src/descriptors/module/imp.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/imp.rs b/crates/ra_analysis/src/descriptors/module/imp.rs
index d4dce861f..80892acb7 100644
--- a/crates/ra_analysis/src/descriptors/module/imp.rs
+++ b/crates/ra_analysis/src/descriptors/module/imp.rs
@@ -94,10 +94,7 @@ fn create_module_tree<'a>(
94 db: &impl DescriptorDatabase, 94 db: &impl DescriptorDatabase,
95 source_root: SourceRootId, 95 source_root: SourceRootId,
96) -> Cancelable<ModuleTree> { 96) -> Cancelable<ModuleTree> {
97 let mut tree = ModuleTree { 97 let mut tree = ModuleTree::default();
98 mods: Vec::new(),
99 links: Vec::new(),
100 };
101 98
102 let mut roots = FxHashMap::default(); 99 let mut roots = FxHashMap::default();
103 let mut visited = FxHashSet::default(); 100 let mut visited = FxHashSet::default();
@@ -154,7 +151,7 @@ fn build_subtree(
154 .into_iter() 151 .into_iter()
155 .map(|file_id| match roots.remove(&file_id) { 152 .map(|file_id| match roots.remove(&file_id) {
156 Some(module_id) => { 153 Some(module_id) => {
157 tree.module_mut(module_id).parent = Some(link); 154 tree.mods[module_id].parent = Some(link);
158 Ok(module_id) 155 Ok(module_id)
159 } 156 }
160 None => build_subtree( 157 None => build_subtree(
@@ -184,8 +181,8 @@ fn build_subtree(
184 } 181 }
185 }; 182 };
186 183
187 tree.link_mut(link).points_to = points_to; 184 tree.links[link].points_to = points_to;
188 tree.link_mut(link).problem = problem; 185 tree.links[link].problem = problem;
189 } 186 }
190 Ok(id) 187 Ok(id)
191} 188}