Update crates/ide-db/src/syntax_helpers/node_ext.rs
Co-authored-by: Bastiaan Marinus van de Weerd <id@bm-w.eu>
This commit is contained in:
parent
5857836047
commit
c0519daf3b
@ -52,9 +52,8 @@ 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) {
|
||||
let node = Some(node.clone());
|
||||
if node != let_stmt.initializer().map(|it| it.syntax().clone())
|
||||
&& node != let_stmt.let_else().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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user