diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-29 11:33:25 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2015-09-29 11:33:25 +0300 |
| commit | 4764d98223bfca20e10d87a80b11f658aab01906 (patch) | |
| tree | 4e8c77ed36a04045883320720ff0f1327740655b /src/libsyntax/visit.rs | |
| parent | 4744d56846c0ed137c0a59fcc8ade8078e3a3431 (diff) | |
| download | rust-4764d98223bfca20e10d87a80b11f658aab01906.tar.gz rust-4764d98223bfca20e10d87a80b11f658aab01906.zip | |
Restore `if let`s replaced with `for`s
Diffstat (limited to 'src/libsyntax/visit.rs')
| -rw-r--r-- | src/libsyntax/visit.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index fd30f47ca20..67e4927a52f 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -353,7 +353,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) { walk_list!(visitor, visit_lifetime_def, &function_declaration.lifetimes); } TyPath(ref maybe_qself, ref path) => { - for qself in maybe_qself { + if let Some(ref qself) = *maybe_qself { visitor.visit_ty(&qself.ty); } visitor.visit_path(path, typ.id); @@ -428,7 +428,7 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) { match pattern.node { PatEnum(ref path, ref opt_children) => { visitor.visit_path(path, pattern.id); - for children in opt_children { + if let Some(ref children) = *opt_children { walk_list!(visitor, visit_pat, children); } } @@ -767,7 +767,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) { walk_list!(visitor, visit_expr, end); } ExprPath(ref maybe_qself, ref path) => { - for qself in maybe_qself { + if let Some(ref qself) = *maybe_qself { visitor.visit_ty(&qself.ty); } visitor.visit_path(path, expression.id) |
