Skip to content

Commit 13834e6

Browse files
committed
fmt
1 parent 17155c8 commit 13834e6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

clippy_lints/src/match_result_ok.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ declare_lint_pass!(MatchResultOk => [MATCH_RESULT_OK]);
4747

4848
impl<'tcx> LateLintPass<'tcx> for MatchResultOk {
4949
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
50-
let (let_pat, let_expr, ifwhile) = if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) {
51-
(let_pat, let_expr, "if")
52-
} else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) {
53-
(let_pat, let_expr, "while")
54-
} else {
55-
return
56-
};
50+
let (let_pat, let_expr, ifwhile) =
51+
if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) {
52+
(let_pat, let_expr, "if")
53+
} else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) {
54+
(let_pat, let_expr, "while")
55+
} else {
56+
return;
57+
};
5758

5859
if_chain! {
5960
if let ExprKind::MethodCall(_, ok_span, [ref result_types_0, ..], _) = let_expr.kind; //check is expr.ok() has type Result<T,E>.ok(, _)

0 commit comments

Comments
 (0)