Skip to content

Commit 108c04a

Browse files
committed
Stop visiting once it's found Let
1 parent d989f43 commit 108c04a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/needless_if.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ impl Visitor<'_> for IsAnyLetVisitor {
9696
fn visit_expr(&mut self, expr: &Expr<'_>) {
9797
if matches!(expr.kind, ExprKind::Let(..)) {
9898
self.0 = true;
99+
} else {
100+
walk_expr(self, expr);
99101
}
100-
101-
walk_expr(self, expr);
102102
}
103103
}

0 commit comments

Comments
 (0)