From b7bef4c8a4029d231fae492bb3cf5d334c19fd0a Mon Sep 17 00:00:00 2001 From: Caio Date: Fri, 16 Sep 2022 17:01:29 -0300 Subject: [PATCH] Change method's name --- clippy_lints/src/operators/arithmetic_side_effects.rs | 8 ++++---- 1 file 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, expr: &hir::Expr<'_>) -> bool { + fn has_valid_op(op: &Spanned, 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 {