about summary refs log tree commit diff
path: root/clippy_lints/src/operators/numeric_arithmetic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'clippy_lints/src/operators/numeric_arithmetic.rs')
-rw-r--r--clippy_lints/src/operators/numeric_arithmetic.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/clippy_lints/src/operators/numeric_arithmetic.rs b/clippy_lints/src/operators/numeric_arithmetic.rs
index 96c9775e292..e6be536ca0f 100644
--- a/clippy_lints/src/operators/numeric_arithmetic.rs
+++ b/clippy_lints/src/operators/numeric_arithmetic.rs
@@ -75,10 +75,10 @@ impl Context {
             hir::BodyOwnerKind::Static(_) | hir::BodyOwnerKind::Const { .. } => {
                 let body_span = cx.tcx.hir_span_with_body(body_owner);
 
-                if let Some(span) = self.const_span {
-                    if span.contains(body_span) {
-                        return;
-                    }
+                if let Some(span) = self.const_span
+                    && span.contains(body_span)
+                {
+                    return;
                 }
                 self.const_span = Some(body_span);
             },
@@ -90,10 +90,10 @@ impl Context {
         let body_owner = cx.tcx.hir_body_owner(body.id());
         let body_span = cx.tcx.hir_span_with_body(body_owner);
 
-        if let Some(span) = self.const_span {
-            if span.contains(body_span) {
-                return;
-            }
+        if let Some(span) = self.const_span
+            && span.contains(body_span)
+        {
+            return;
         }
         self.const_span = None;
     }