]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/arithmetic.rs
MutImmutable -> Immutable, MutMutable -> Mutable, CaptureClause -> CaptureBy
[rust.git] / clippy_lints / src / arithmetic.rs
index d94cd668bddc6db21adf6a29fb0bef2052ecaba3..1cca897e73900b9eaa11fde39574f522d2585387 100644 (file)
@@ -16,7 +16,8 @@
     ///
     /// **Example:**
     /// ```rust
-    /// a + 1
+    /// # let a = 0;
+    /// a + 1;
     /// ```
     pub INTEGER_ARITHMETIC,
     restriction,
@@ -33,7 +34,8 @@
     ///
     /// **Example:**
     /// ```rust
-    /// a + 1.0
+    /// # let a = 0.0;
+    /// a + 1.0;
     /// ```
     pub FLOAT_ARITHMETIC,
     restriction,
@@ -61,8 +63,8 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
                 return;
             }
         }
-        match &expr.node {
-            hir::ExprKind::Binary(op, l, r) => {
+        match &expr.kind {
+            hir::ExprKind::Binary(op, l, r) | hir::ExprKind::AssignOp(op, l, r) => {
                 match op.node {
                     hir::BinOpKind::And
                     | hir::BinOpKind::Or