Skip to content

Commit d639062

Browse files
committed
Address comments
1 parent cd0009e commit d639062

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

clippy_lints/src/operators/numeric_arithmetic.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ impl Context {
1919
self.expr_id.is_some() || self.const_span.map_or(false, |span| span.contains(e.span))
2020
}
2121

22-
fn skip_expr_involving_integers<'tcx>(cx: &LateContext<'tcx>, e: &hir::Expr<'tcx>) -> bool {
23-
is_from_proc_macro(cx, e)
24-
}
25-
2622
pub fn check_binary<'tcx>(
2723
&mut self,
2824
cx: &LateContext<'tcx>,
@@ -51,7 +47,7 @@ impl Context {
5147

5248
let (l_ty, r_ty) = (cx.typeck_results().expr_ty(l), cx.typeck_results().expr_ty(r));
5349
if l_ty.peel_refs().is_integral() && r_ty.peel_refs().is_integral() {
54-
if Self::skip_expr_involving_integers(cx, expr) {
50+
if is_from_proc_macro(cx, expr) {
5551
return;
5652
}
5753
match op {
@@ -86,7 +82,7 @@ impl Context {
8682
let ty = cx.typeck_results().expr_ty(arg);
8783
if constant_simple(cx, cx.typeck_results(), expr).is_none() {
8884
if ty.is_integral() {
89-
if Self::skip_expr_involving_integers(cx, expr) {
85+
if is_from_proc_macro(cx, expr) {
9086
return;
9187
}
9288
span_lint(cx, INTEGER_ARITHMETIC, expr.span, "integer arithmetic detected");

0 commit comments

Comments
 (0)