diff options
| author | Alex Macleod <alex@macleod.io> | 2024-05-17 16:45:00 +0000 |
|---|---|---|
| committer | Alex Macleod <alex@macleod.io> | 2024-05-19 16:47:02 +0000 |
| commit | e6040437ef5e6f2ac8110fd160c58ec2fa8ad202 (patch) | |
| tree | 8c0080445f3be3501f67abbf136b39802c329f56 /clippy_lints/src/zero_repeat_side_effects.rs | |
| parent | 680256f3ce369da4d305bb4e0c037672d2625b8b (diff) | |
Swap `for_each_expr` and `for_each_expr_with_closures`
Diffstat (limited to 'clippy_lints/src/zero_repeat_side_effects.rs')
| -rw-r--r-- | clippy_lints/src/zero_repeat_side_effects.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/zero_repeat_side_effects.rs b/clippy_lints/src/zero_repeat_side_effects.rs index 143fecdd237..da198b78d2e 100644 --- a/clippy_lints/src/zero_repeat_side_effects.rs +++ b/clippy_lints/src/zero_repeat_side_effects.rs @@ -1,7 +1,7 @@ use clippy_utils::diagnostics::span_lint_and_sugg; use clippy_utils::higher::VecArgs; use clippy_utils::source::snippet; -use clippy_utils::visitors::for_each_expr; +use clippy_utils::visitors::for_each_expr_without_closures; use rustc_ast::LitKind; use rustc_errors::Applicability; use rustc_hir::{ExprKind, Node}; @@ -66,7 +66,7 @@ impl LateLintPass<'_> for ZeroRepeatSideEffects { fn inner_check(cx: &LateContext<'_>, expr: &'_ rustc_hir::Expr<'_>, inner_expr: &'_ rustc_hir::Expr<'_>, is_vec: bool) { // check if expr is a call or has a call inside it - if for_each_expr(inner_expr, |x| { + if for_each_expr_without_closures(inner_expr, |x| { if let ExprKind::Call(_, _) | ExprKind::MethodCall(_, _, _, _) = x.kind { std::ops::ControlFlow::Break(()) } else { |
