From 3973974de133867c46727ed516b0445d7f1cb63f Mon Sep 17 00:00:00 2001 From: Ville Penttinen Date: Wed, 13 Feb 2019 18:02:18 +0200 Subject: Fix possible issue where unnamed is_symbol_def would pop stack wrongly This removes is_symbol_def as unnecessary. --- crates/ra_ide_api/src/symbol_index.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 100df8279..afb10fa92 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -200,16 +200,6 @@ fn is_type(kind: SyntaxKind) -> bool { } } -fn is_symbol_def(kind: SyntaxKind) -> bool { - match kind { - FN_DEF | STRUCT_DEF | ENUM_DEF | TRAIT_DEF | MODULE | TYPE_DEF | CONST_DEF | STATIC_DEF => { - true - } - - _ => false, - } -} - /// The actual data that is stored in the index. It should be as compact as /// possible. #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -236,7 +226,7 @@ fn source_file_to_file_symbols(source_file: &SourceFile, file_id: FileId) -> Vec } WalkEvent::Leave(node) => { - if is_symbol_def(node.kind()) { + if to_symbol(node).is_some() { stack.pop(); } } -- cgit v1.2.3