about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAda Alakbarova <ada.alakbarova@proton.me>2025-08-20 01:41:58 +0200
committerAda Alakbarova <ada.alakbarova@proton.me>2025-08-22 15:03:13 +0200
commit804c9ac52a9329a4a5bcf53ef6d4326d72d34e25 (patch)
treed2c755082273e99505992ed3046c1edc48cbf10d
parentb987e0178e3b17d7d7d1f39308c44b93668a100b (diff)
misc: match in multiple steps
-rw-r--r--clippy_lints/src/entry.rs18
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)?;