Skip to content

Commit 22ba792

Browse files
Update clippy_lints/src/option_if_let_else.rs
Co-authored-by: Samuel Tardieu <sam@rfc1149.net>
1 parent 438f934 commit 22ba792

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clippy_lints/src/option_if_let_else.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,10 @@ fn try_get_option_occurrence<'tcx>(
197197

198198
/// Gets the call expr iff it does not have any args and was not from macro expansion.
199199
fn try_get_argless_call_expr<'tcx>(expr: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> {
200-
if !expr.span.from_expansion() &&
201-
let ExprKind::Call(call_expr, []) = expr.kind
202-
{
203-
return Some(call_expr);
200+
match expr.kind {
201+
ExprKind::Call(call_expr, []) if !expr.span.from_expansion() => Some(call_expr),
202+
_ => None,
204203
}
205-
None
206204
}
207205

208206
fn try_get_inner_pat_and_is_result<'tcx>(cx: &LateContext<'tcx>, pat: &Pat<'tcx>) -> Option<(&'tcx Pat<'tcx>, bool)> {

0 commit comments

Comments
 (0)