Replacing match block with if block as conditional was boolean
This commit is contained in:
parent
1ead12c500
commit
32404741c6
@ -1021,10 +1021,7 @@ fn lint_expect_fun_call(cx: &LateContext, expr: &hir::Expr, method_span: Span, n
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let closure = match match_type(cx, self_type, &paths::OPTION) {
|
let closure = if match_type(cx, self_type, &paths::OPTION) { "||" } else { "|_|" };
|
||||||
true => "||",
|
|
||||||
false => "|_|",
|
|
||||||
};
|
|
||||||
|
|
||||||
let sugg: Cow<_> = snippet(cx, arg.span, "..");
|
let sugg: Cow<_> = snippet(cx, arg.span, "..");
|
||||||
let span_replace_word = method_span.with_hi(span.hi());
|
let span_replace_word = method_span.with_hi(span.hi());
|
||||||
|
Loading…
Reference in New Issue
Block a user