From: Manish Goregaokar Date: Tue, 28 Sep 2021 05:33:45 +0000 (-0700) Subject: fmt X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=13834e6ad2294a95c664aca2acaedb1a9619773f;p=rust.git fmt --- diff --git a/clippy_lints/src/match_result_ok.rs b/clippy_lints/src/match_result_ok.rs index 650bb167b73..c7de06f0815 100644 --- a/clippy_lints/src/match_result_ok.rs +++ b/clippy_lints/src/match_result_ok.rs @@ -47,13 +47,14 @@ impl<'tcx> LateLintPass<'tcx> for MatchResultOk { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { - let (let_pat, let_expr, ifwhile) = if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) { - (let_pat, let_expr, "if") - } else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) { - (let_pat, let_expr, "while") - } else { - return - }; + let (let_pat, let_expr, ifwhile) = + if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) { + (let_pat, let_expr, "if") + } else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) { + (let_pat, let_expr, "while") + } else { + return; + }; if_chain! { if let ExprKind::MethodCall(_, ok_span, [ref result_types_0, ..], _) = let_expr.kind; //check is expr.ok() has type Result.ok(, _)