]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/loops/while_let_loop.rs
separate the receiver from arguments in HIR under /clippy
[rust.git] / clippy_lints / src / loops / while_let_loop.rs
index ca617859db49d713ea5fe3ffa4fc0aaa52e0f771..735d704a43cee343dcdb0ea76dea3a02566e6815 100644 (file)
 pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, loop_block: &'tcx Block<'_>) {
     let (init, has_trailing_exprs) = match (loop_block.stmts, loop_block.expr) {
         ([stmt, stmts @ ..], expr) => {
-            if let StmtKind::Local(&Local { init: Some(e), els: None, .. }) | StmtKind::Semi(e) | StmtKind::Expr(e) = stmt.kind {
+            if let StmtKind::Local(&Local {
+                init: Some(e),
+                els: None,
+                ..
+            })
+            | StmtKind::Semi(e)
+            | StmtKind::Expr(e) = stmt.kind
+            {
                 (e, !stmts.is_empty() || expr.is_some())
             } else {
                 return;