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)