From 32404741c67a3262143e1f00f9fb31c86e684444 Mon Sep 17 00:00:00 2001 From: Donald Robertson Date: Mon, 4 Jun 2018 19:19:01 +0100 Subject: [PATCH] Replacing match block with if block as conditional was boolean --- clippy_lints/src/methods.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/clippy_lints/src/methods.rs b/clippy_lints/src/methods.rs index 38413c5aa4d..aad2f090886 100644 --- a/clippy_lints/src/methods.rs +++ b/clippy_lints/src/methods.rs @@ -1021,10 +1021,7 @@ fn lint_expect_fun_call(cx: &LateContext, expr: &hir::Expr, method_span: Span, n return; } - let closure = match match_type(cx, self_type, &paths::OPTION) { - true => "||", - false => "|_|", - }; + let closure = if match_type(cx, self_type, &paths::OPTION) { "||" } else { "|_|" }; let sugg: Cow<_> = snippet(cx, arg.span, ".."); let span_replace_word = method_span.with_hi(span.hi());