mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
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
1 changed files with 2 additions and 3 deletions
|
@ -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) {
|
if let Some(let_stmt) = node.parent().and_then(ast::LetStmt::cast) {
|
||||||
let node = Some(node.clone());
|
if let_stmt.initializer().map(|it| it.syntax() != &node).unwrap_or(true)
|
||||||
if node != let_stmt.initializer().map(|it| it.syntax().clone())
|
&& let_stmt.let_else().map(|it| it.syntax() != &node).unwrap_or(true)
|
||||||
&& node != let_stmt.let_else().map(|it| it.syntax().clone())
|
|
||||||
{
|
{
|
||||||
// skipping potential const pat expressions in let statements
|
// skipping potential const pat expressions in let statements
|
||||||
preorder.skip_subtree();
|
preorder.skip_subtree();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue