Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c0519da

Browse files
Veykrilbm-w
andauthored
Update crates/ide-db/src/syntax_helpers/node_ext.rs
Co-authored-by: Bastiaan Marinus van de Weerd <[email protected]>
1 parent 5857836 commit c0519da

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/ide-db/src/syntax_helpers/node_ext.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ pub fn preorder_expr(start: &ast::Expr, cb: &mut dyn FnMut(WalkEvent<ast::Expr>)
5252
}
5353
};
5454
if let Some(let_stmt) = node.parent().and_then(ast::LetStmt::cast) {
55-
let node = Some(node.clone());
56-
if node != let_stmt.initializer().map(|it| it.syntax().clone())
57-
&& node != let_stmt.let_else().map(|it| it.syntax().clone())
55+
if let_stmt.initializer().map(|it| it.syntax() != &node).unwrap_or(true)
56+
&& let_stmt.let_else().map(|it| it.syntax() != &node).unwrap_or(true)
5857
{
5958
// skipping potential const pat expressions in let statements
6059
preorder.skip_subtree();

0 commit comments

Comments
 (0)