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
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);
}
}
}