Skip to content

Commit 3240474

Browse files
author
Donald Robertson
committed
Replacing match block with if block as conditional was boolean
1 parent 1ead12c commit 3240474

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

clippy_lints/src/methods.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,7 @@ fn lint_expect_fun_call(cx: &LateContext, expr: &hir::Expr, method_span: Span, n
10211021
return;
10221022
}
10231023

1024-
let closure = match match_type(cx, self_type, &paths::OPTION) {
1025-
true => "||",
1026-
false => "|_|",
1027-
};
1024+
let closure = if match_type(cx, self_type, &paths::OPTION) { "||" } else { "|_|" };
10281025

10291026
let sugg: Cow<_> = snippet(cx, arg.span, "..");
10301027
let span_replace_word = method_span.with_hi(span.hi());

0 commit comments

Comments
 (0)