diff options
| -rw-r--r-- | clippy_lints/src/entry.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/clippy_lints/src/entry.rs b/clippy_lints/src/entry.rs index dd38aab6e3f..53dc2c05add 100644 --- a/clippy_lints/src/entry.rs +++ b/clippy_lints/src/entry.rs @@ -254,18 +254,12 @@ fn try_parse_contains<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Optio _ => None, }); - if let ExprKind::MethodCall( - _, - map, - [ - Expr { - kind: ExprKind::AddrOf(_, _, key), - span: key_span, - .. - }, - ], - _, - ) = expr.kind + if let ExprKind::MethodCall(_, map, [arg], _) = expr.kind + && let Expr { + kind: ExprKind::AddrOf(_, _, key), + span: key_span, + .. + } = arg && key_span.eq_ctxt(expr.span) { let id = cx.typeck_results().type_dependent_def_id(expr.hir_id)?; |
