Skip to content

Commit 3973974

Browse files
committed
Fix possible issue where unnamed is_symbol_def would pop stack wrongly
This removes is_symbol_def as unnecessary.
1 parent 0c37a9c commit 3973974

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

crates/ra_ide_api/src/symbol_index.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,6 @@ fn is_type(kind: SyntaxKind) -> bool {
200200
}
201201
}
202202

203-
fn is_symbol_def(kind: SyntaxKind) -> bool {
204-
match kind {
205-
FN_DEF | STRUCT_DEF | ENUM_DEF | TRAIT_DEF | MODULE | TYPE_DEF | CONST_DEF | STATIC_DEF => {
206-
true
207-
}
208-
209-
_ => false,
210-
}
211-
}
212-
213203
/// The actual data that is stored in the index. It should be as compact as
214204
/// possible.
215205
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@@ -236,7 +226,7 @@ fn source_file_to_file_symbols(source_file: &SourceFile, file_id: FileId) -> Vec
236226
}
237227

238228
WalkEvent::Leave(node) => {
239-
if is_symbol_def(node.kind()) {
229+
if to_symbol(node).is_some() {
240230
stack.pop();
241231
}
242232
}

0 commit comments

Comments
 (0)