]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/float_equality_without_abs.rs
Rollup merge of #85760 - ChrisDenton:path-doc-platform-specific, r=m-ou-se
[rust.git] / src / tools / clippy / clippy_lints / src / float_equality_without_abs.rs
index 0c59db360f9a24bfd6e2acca3b26440fbf691bef..b5ebe5f90ba25c6733ccafe8f054db109f08ed1f 100644 (file)
@@ -48,7 +48,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
         let rhs;
 
         // check if expr is a binary expression with a lt or gt operator
-        if let ExprKind::Binary(op, ref left, ref right) = expr.kind {
+        if let ExprKind::Binary(op, left, right) = expr.kind {
             match op.node {
                 BinOpKind::Lt => {
                     lhs = left;
@@ -88,8 +88,8 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
             if let ty::Float(_) = t_val_r.kind();
 
             then {
-                let sug_l = sugg::Sugg::hir(cx, &val_l, "..");
-                let sug_r = sugg::Sugg::hir(cx, &val_r, "..");
+                let sug_l = sugg::Sugg::hir(cx, val_l, "..");
+                let sug_r = sugg::Sugg::hir(cx, val_r, "..");
                 // format the suggestion
                 let suggestion = format!("{}.abs()", sugg::make_assoc(AssocOp::Subtract, &sug_l, &sug_r).maybe_par());
                 // spans the lint