Skip to content

Commit c987818

Browse files
committed
misc: match in multiple steps
1 parent 5142695 commit c987818

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

clippy_lints/src/entry.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,18 +254,12 @@ fn try_parse_contains<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Optio
254254
_ => None,
255255
});
256256

257-
if let ExprKind::MethodCall(
258-
_,
259-
map,
260-
[
261-
Expr {
262-
kind: ExprKind::AddrOf(_, _, key),
263-
span: key_span,
264-
..
265-
},
266-
],
267-
_,
268-
) = expr.kind
257+
if let ExprKind::MethodCall(_, map, [arg], _) = expr.kind
258+
&& let Expr {
259+
kind: ExprKind::AddrOf(_, _, key),
260+
span: key_span,
261+
..
262+
} = arg
269263
&& key_span.eq_ctxt(expr.span)
270264
{
271265
let id = cx.typeck_results().type_dependent_def_id(expr.hir_id)?;

0 commit comments

Comments
 (0)