]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/methods/implicit_clone.rs
Rollup merge of #104504 - compiler-errors:fru-syntax-note, r=estebank
[rust.git] / src / tools / clippy / clippy_lints / src / methods / implicit_clone.rs
index 9651a52be4e7281a28a4891a942c5d415d3de761..429cdc1918d79d7c03d1d5b24fe1bff04c8e7afb 100644 (file)
@@ -26,12 +26,12 @@ pub fn check(cx: &LateContext<'_>, method_name: &str, expr: &hir::Expr<'_>, recv
                 cx,
                 IMPLICIT_CLONE,
                 expr.span,
-                &format!("implicitly cloning a `{}` by calling `{}` on its dereferenced type", ty_name, method_name),
+                &format!("implicitly cloning a `{ty_name}` by calling `{method_name}` on its dereferenced type"),
                 "consider using",
                 if ref_count > 1 {
-                    format!("({}{}).clone()", "*".repeat(ref_count - 1), recv_snip)
+                    format!("({}{recv_snip}).clone()", "*".repeat(ref_count - 1))
                 } else {
-                    format!("{}.clone()", recv_snip)
+                    format!("{recv_snip}.clone()")
                 },
                 app,
             );