From 6dbcf144b1f8a451d614459343df6f8d599ca57d Mon Sep 17 00:00:00 2001 From: AurelienFT Date: Fri, 7 Jun 2024 21:50:28 +0200 Subject: [PATCH] Use new version of for_each_expr in check_manual_pattern_char_comparison --- clippy_lints/src/string_patterns.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/string_patterns.rs b/clippy_lints/src/string_patterns.rs index 69fb97188a7f..64b5b8f9f27b 100644 --- a/clippy_lints/src/string_patterns.rs +++ b/clippy_lints/src/string_patterns.rs @@ -131,7 +131,7 @@ fn check_manual_pattern_char_comparison(cx: &LateContext<'_>, method_arg: &Expr< // We want to retrieve all the comparisons done. // They are ordered in a nested way and so we need to traverse the AST to collect them all. - if for_each_expr(body.value, |sub_expr| -> ControlFlow<(), Descend> { + if for_each_expr(cx, body.value, |sub_expr| -> ControlFlow<(), Descend> { match sub_expr.kind { ExprKind::Binary(op, left, right) if op.node == BinOpKind::Eq => { if path_to_local_id(left, binding)