diff options
-rw-r--r-- | crates/ra_hir_def/src/data.rs | 7 | ||||
-rw-r--r-- | crates/ra_hir_def/src/item_tree/lower.rs | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 51c97c584..5f8eb72a0 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs | |||
@@ -234,10 +234,9 @@ fn collect_items( | |||
234 | // FIXME: cfg? | 234 | // FIXME: cfg? |
235 | AssocItem::Const(id) => { | 235 | AssocItem::Const(id) => { |
236 | let item = &item_tree[id]; | 236 | let item = &item_tree[id]; |
237 | let name = if let Some(name) = item.name.clone() { | 237 | let name = match item.name.clone() { |
238 | name | 238 | Some(name) => name, |
239 | } else { | 239 | None => continue, |
240 | continue; | ||
241 | }; | 240 | }; |
242 | let def = ConstLoc { container, id: ItemTreeId::new(file_id, id) }.intern(db); | 241 | let def = ConstLoc { container, id: ItemTreeId::new(file_id, id) }.intern(db); |
243 | items.push((name, def.into())); | 242 | items.push((name, def.into())); |
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs index b97927f27..733fcac7a 100644 --- a/crates/ra_hir_def/src/item_tree/lower.rs +++ b/crates/ra_hir_def/src/item_tree/lower.rs | |||
@@ -136,7 +136,7 @@ impl Ctx { | |||
136 | 136 | ||
137 | fn collect_inner_items(&mut self, container: &SyntaxNode) { | 137 | fn collect_inner_items(&mut self, container: &SyntaxNode) { |
138 | let forced_vis = self.forced_visibility.take(); | 138 | let forced_vis = self.forced_visibility.take(); |
139 | let mut inner_items = mem::replace(&mut self.tree.inner_items, FxHashMap::default()); | 139 | let mut inner_items = mem::take(&mut self.tree.inner_items); |
140 | inner_items.extend( | 140 | inner_items.extend( |
141 | container.descendants().skip(1).filter_map(ast::ModuleItem::cast).filter_map(|item| { | 141 | container.descendants().skip(1).filter_map(ast::ModuleItem::cast).filter_map(|item| { |
142 | let ast_id = self.source_ast_id_map.ast_id(&item); | 142 | let ast_id = self.source_ast_id_map.ast_id(&item); |