misc: match in multiple steps

This commit is contained in:
Ada Alakbarova
2025-08-20 01:41:58 +02:00
parent b987e0178e
commit 804c9ac52a
+6 -12
View File
@@ -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)?;