Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/syntax_helpers/node_ext.rs')
| -rw-r--r-- | crates/ide-db/src/syntax_helpers/node_ext.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ide-db/src/syntax_helpers/node_ext.rs b/crates/ide-db/src/syntax_helpers/node_ext.rs index a34dc1b695..22ced69d81 100644 --- a/crates/ide-db/src/syntax_helpers/node_ext.rs +++ b/crates/ide-db/src/syntax_helpers/node_ext.rs @@ -52,7 +52,9 @@ pub fn preorder_expr(start: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>) } }; if let Some(let_stmt) = node.parent().and_then(ast::LetStmt::cast) { - if Some(node.clone()) != let_stmt.initializer().map(|it| it.syntax().clone()) { + if let_stmt.initializer().map(|it| it.syntax() != &node).unwrap_or(true) + && let_stmt.let_else().map(|it| it.syntax() != &node).unwrap_or(true) + { // skipping potential const pat expressions in let statements preorder.skip_subtree(); continue; |