mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Rustup to *rustc 1.19.0-nightly (0418fa9d3 2017-06-04)*
This commit is contained in:
parent
5a6e48fd27
commit
01cae3fd6d
1 changed files with 6 additions and 9 deletions
|
@ -129,16 +129,13 @@ pub fn for_loop(expr: &hir::Expr) -> Option<(&hir::Pat, &hir::Expr, &hir::Expr)>
|
|||
let hir::ExprCall(_, ref iterargs) = iterexpr.node,
|
||||
iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none(),
|
||||
let hir::ExprLoop(ref block, _, _) = arms[0].body.node,
|
||||
block.stmts.is_empty(),
|
||||
let Some(ref loopexpr) = block.expr,
|
||||
let hir::ExprMatch(_, ref innerarms, hir::MatchSource::ForLoopDesugar) = loopexpr.node,
|
||||
innerarms.len() == 2 && innerarms[0].pats.len() == 1,
|
||||
let hir::PatKind::TupleStruct(_, ref somepats, _) = innerarms[0].pats[0].node,
|
||||
somepats.len() == 1
|
||||
block.expr.is_none(),
|
||||
let [ ref let_stmt, ref body ] = *block.stmts,
|
||||
let hir::StmtDecl(ref decl, _) = let_stmt.node,
|
||||
let hir::DeclLocal(ref decl) = decl.node,
|
||||
let hir::StmtExpr(ref expr, _) = body.node,
|
||||
], {
|
||||
return Some((&somepats[0],
|
||||
&iterargs[0],
|
||||
&innerarms[0].body));
|
||||
return Some((&*decl.pat, &iterargs[0], expr));
|
||||
}}
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue