diff options
| author | Caio <c410.f3r@gmail.com> | 2022-09-16 17:01:29 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2022-09-16 17:01:29 -0300 |
| commit | b7bef4c8a4029d231fae492bb3cf5d334c19fd0a (patch) | |
| tree | 8ccaa45704440087a3522c7d9964fad62460a797 | |
| parent | 8bfe3db531993eef4c5de43e48c40d55f803e94d (diff) | |
| download | rust-b7bef4c8a4029d231fae492bb3cf5d334c19fd0a.tar.gz rust-b7bef4c8a4029d231fae492bb3cf5d334c19fd0a.zip | |
Change method's name
| -rw-r--r-- | clippy_lints/src/operators/arithmetic_side_effects.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/operators/arithmetic_side_effects.rs b/clippy_lints/src/operators/arithmetic_side_effects.rs index 0070eef52e4..d24c57c0a4b 100644 --- a/clippy_lints/src/operators/arithmetic_side_effects.rs +++ b/clippy_lints/src/operators/arithmetic_side_effects.rs @@ -42,9 +42,9 @@ impl ArithmeticSideEffects { } } - /// Assuming that `expr` is a literal integer, checks assign operators (+=, -=, *=, /=) in a + /// Assuming that `expr` is a literal integer, checks operators (+=, -=, *, /) in a /// non-constant environment that won't overflow. - fn has_valid_assign_op(op: &Spanned<hir::BinOpKind>, expr: &hir::Expr<'_>) -> bool { + fn has_valid_op(op: &Spanned<hir::BinOpKind>, expr: &hir::Expr<'_>) -> bool { if let hir::BinOpKind::Add | hir::BinOpKind::Sub = op.node && let hir::ExprKind::Lit(ref lit) = expr.kind && let ast::LitKind::Int(0, _) = lit.node @@ -124,8 +124,8 @@ impl ArithmeticSideEffects { Self::is_literal_integer(rhs, cx.typeck_results().expr_ty(rhs).peel_refs()), ) { (true, true) => true, - (true, false) => Self::has_valid_assign_op(op, lhs), - (false, true) => Self::has_valid_assign_op(op, rhs), + (true, false) => Self::has_valid_op(op, lhs), + (false, true) => Self::has_valid_op(op, rhs), (false, false) => false, }; if !has_valid_op { |
