]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/swap.rs
Rollup merge of #106410 - clubby789:borrow-mut-self-mut-self-diag, r=compiler-errors
[rust.git] / src / tools / clippy / clippy_lints / src / swap.rs
index c374529d1ea9f5abc9fd54bf49a36163c47463e7..17e9cc5f6b7c7a7d72a5fd73fed5f043c366708d 100644 (file)
@@ -132,7 +132,7 @@ fn generate_swap_warning(cx: &LateContext<'_>, e1: &Expr<'_>, e2: &Expr<'_>, spa
                 applicability,
             );
             if !is_xor_based {
-                diag.note(&format!("or maybe you should use `{sugg}::mem::replace`?"));
+                diag.note(format!("or maybe you should use `{sugg}::mem::replace`?"));
             }
         },
     );
@@ -214,7 +214,7 @@ fn check_suspicious_swap(cx: &LateContext<'_>, block: &Block<'_>) {
                                 Applicability::MaybeIncorrect,
                             );
                             diag.note(
-                                &format!("or maybe you should use `{sugg}::mem::replace`?")
+                                format!("or maybe you should use `{sugg}::mem::replace`?")
                             );
                         }
                     });