mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-28 07:30:57 +00:00
Merge pull request #1855 from Manishearth/for_loop
Fix for loop detection
This commit is contained in:
commit
687fe1e1a9
1 changed files with 1 additions and 1 deletions
|
@ -129,7 +129,7 @@ pub fn for_loop(expr: &hir::Expr) -> Option<(&hir::Pat, &hir::Expr, &hir::Expr)>
|
||||||
iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none(),
|
iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none(),
|
||||||
let hir::ExprLoop(ref block, _, _) = arms[0].body.node,
|
let hir::ExprLoop(ref block, _, _) = arms[0].body.node,
|
||||||
block.expr.is_none(),
|
block.expr.is_none(),
|
||||||
let [ ref let_stmt, ref body ] = *block.stmts,
|
let [ _, _, ref let_stmt, ref body ] = *block.stmts,
|
||||||
let hir::StmtDecl(ref decl, _) = let_stmt.node,
|
let hir::StmtDecl(ref decl, _) = let_stmt.node,
|
||||||
let hir::DeclLocal(ref decl) = decl.node,
|
let hir::DeclLocal(ref decl) = decl.node,
|
||||||
let hir::StmtExpr(ref expr, _) = body.node,
|
let hir::StmtExpr(ref expr, _) = body.node,
|
||||||
|
|
Loading…
Reference in a new issue