]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/int_plus_one.rs
Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / int_plus_one.rs
index e91fb0c2f27cd0340caf1ace6afb0fb8e70d7098..c629ee05ab97c1e2740441170c3ad142c857fbb7 100644 (file)
@@ -152,7 +152,7 @@ fn emit_warning(cx: &EarlyContext<'_>, block: &Expr, recommendation: String) {
             cx,
             INT_PLUS_ONE,
             block.span,
-            "Unnecessary `>= y + 1` or `x - 1 >=`",
+            "unnecessary `>= y + 1` or `x - 1 >=`",
             "change it to",
             recommendation,
             Applicability::MachineApplicable, // snippet
@@ -163,8 +163,8 @@ fn emit_warning(cx: &EarlyContext<'_>, block: &Expr, recommendation: String) {
 impl EarlyLintPass for IntPlusOne {
     fn check_expr(&mut self, cx: &EarlyContext<'_>, item: &Expr) {
         if let ExprKind::Binary(ref kind, ref lhs, ref rhs) = item.kind {
-            if let Some(ref rec) = Self::check_binop(cx, kind.node, lhs, rhs) {
-                Self::emit_warning(cx, item, rec.clone());
+            if let Some(rec) = Self::check_binop(cx, kind.node, lhs, rhs) {
+                Self::emit_warning(cx, item, rec);
             }
         }
     }