Skip to content

Commit b7bef4c

Browse files
committed
Change method's name
1 parent 8bfe3db commit b7bef4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/operators/arithmetic_side_effects.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ impl ArithmeticSideEffects {
4242
}
4343
}
4444

45-
/// Assuming that `expr` is a literal integer, checks assign operators (+=, -=, *=, /=) in a
45+
/// Assuming that `expr` is a literal integer, checks operators (+=, -=, *, /) in a
4646
/// non-constant environment that won't overflow.
47-
fn has_valid_assign_op(op: &Spanned<hir::BinOpKind>, expr: &hir::Expr<'_>) -> bool {
47+
fn has_valid_op(op: &Spanned<hir::BinOpKind>, expr: &hir::Expr<'_>) -> bool {
4848
if let hir::BinOpKind::Add | hir::BinOpKind::Sub = op.node
4949
&& let hir::ExprKind::Lit(ref lit) = expr.kind
5050
&& let ast::LitKind::Int(0, _) = lit.node
@@ -124,8 +124,8 @@ impl ArithmeticSideEffects {
124124
Self::is_literal_integer(rhs, cx.typeck_results().expr_ty(rhs).peel_refs()),
125125
) {
126126
(true, true) => true,
127-
(true, false) => Self::has_valid_assign_op(op, lhs),
128-
(false, true) => Self::has_valid_assign_op(op, rhs),
127+
(true, false) => Self::has_valid_op(op, lhs),
128+
(false, true) => Self::has_valid_op(op, rhs),
129129
(false, false) => false,
130130
};
131131
if !has_valid_op {

0 commit comments

Comments
 (0)