]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/int_plus_one.rs
Auto merge of #4551 - mikerite:fix-ice-reporting, r=llogiq
[rust.git] / clippy_lints / src / int_plus_one.rs
index b59179618a6d15d7554a25a46454a845205c09e8..c886743533f8949514b1ad00388e1210acfb6c5a 100644 (file)
     ///
     /// **Example:**
     /// ```rust
-    /// x >= y + 1
+    /// # let x = 1;
+    /// # let y = 1;
+    /// if x >= y + 1 {}
     /// ```
     ///
-    /// Could be written:
+    /// Could be written as:
     ///
     /// ```rust
-    /// x > y
+    /// # let x = 1;
+    /// # let y = 1;
+    /// if x > y {}
     /// ```
     pub INT_PLUS_ONE,
     complexity,
@@ -154,7 +158,7 @@ fn emit_warning(self, cx: &EarlyContext<'_>, block: &Expr, recommendation: Strin
             |db| {
                 db.span_suggestion(
                     block.span,
-                    "change `>= y + 1` to `> y` as shown",
+                    "change it to",
                     recommendation,
                     Applicability::MachineApplicable, // snippet
                 );