mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-24 21:53:56 +00:00
Stop visiting once it's found Let
This commit is contained in:
parent
d989f432a4
commit
108c04acf0
@ -96,8 +96,8 @@ impl Visitor<'_> for IsAnyLetVisitor {
|
|||||||
fn visit_expr(&mut self, expr: &Expr<'_>) {
|
fn visit_expr(&mut self, expr: &Expr<'_>) {
|
||||||
if matches!(expr.kind, ExprKind::Let(..)) {
|
if matches!(expr.kind, ExprKind::Let(..)) {
|
||||||
self.0 = true;
|
self.0 = true;
|
||||||
|
} else {
|
||||||
|
walk_expr(self, expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
walk_expr(self, expr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user