Skip to content

Commit 4764d98

Browse files
committed
Restore if lets replaced with fors
1 parent 4744d56 commit 4764d98

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/librustc_front/visit.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
336336
walk_list!(visitor, visit_lifetime_def, &function_declaration.lifetimes);
337337
}
338338
TyPath(ref maybe_qself, ref path) => {
339-
for qself in maybe_qself {
339+
if let Some(ref qself) = *maybe_qself {
340340
visitor.visit_ty(&qself.ty);
341341
}
342342
visitor.visit_path(path, typ.id);
@@ -408,7 +408,7 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
408408
match pattern.node {
409409
PatEnum(ref path, ref opt_children) => {
410410
visitor.visit_path(path, pattern.id);
411-
for children in opt_children {
411+
if let Some(ref children) = *opt_children {
412412
walk_list!(visitor, visit_pat, children);
413413
}
414414
}
@@ -723,7 +723,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
723723
walk_list!(visitor, visit_expr, end);
724724
}
725725
ExprPath(ref maybe_qself, ref path) => {
726-
for qself in maybe_qself {
726+
if let Some(ref qself) = *maybe_qself {
727727
visitor.visit_ty(&qself.ty);
728728
}
729729
visitor.visit_path(path, expression.id)

src/libsyntax/visit.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
353353
walk_list!(visitor, visit_lifetime_def, &function_declaration.lifetimes);
354354
}
355355
TyPath(ref maybe_qself, ref path) => {
356-
for qself in maybe_qself {
356+
if let Some(ref qself) = *maybe_qself {
357357
visitor.visit_ty(&qself.ty);
358358
}
359359
visitor.visit_path(path, typ.id);
@@ -428,7 +428,7 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
428428
match pattern.node {
429429
PatEnum(ref path, ref opt_children) => {
430430
visitor.visit_path(path, pattern.id);
431-
for children in opt_children {
431+
if let Some(ref children) = *opt_children {
432432
walk_list!(visitor, visit_pat, children);
433433
}
434434
}
@@ -767,7 +767,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
767767
walk_list!(visitor, visit_expr, end);
768768
}
769769
ExprPath(ref maybe_qself, ref path) => {
770-
for qself in maybe_qself {
770+
if let Some(ref qself) = *maybe_qself {
771771
visitor.visit_ty(&qself.ty);
772772
}
773773
visitor.visit_path(path, expression.id)

0 commit comments

Comments
 (0)