]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/inherent_to_string.rs
Rollup merge of #89839 - jkugelman:must-use-mem-ptr-functions, r=joshtriplett
[rust.git] / src / tools / clippy / clippy_lints / src / inherent_to_string.rs
index 3c40ca50a0981aa04c42d6357362fc4aef139311..61dd0eb4af7ed37d7239f2b334bbed4712a7edf8 100644 (file)
@@ -138,10 +138,10 @@ fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) {
             item.span,
             &format!(
                 "type `{}` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`",
-                self_type.to_string()
+                self_type
             ),
             None,
-            &format!("remove the inherent method from type `{}`", self_type.to_string()),
+            &format!("remove the inherent method from type `{}`", self_type),
         );
     } else {
         span_lint_and_help(
@@ -150,10 +150,10 @@ fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) {
             item.span,
             &format!(
                 "implementation of inherent method `to_string(&self) -> String` for type `{}`",
-                self_type.to_string()
+                self_type
             ),
             None,
-            &format!("implement trait `Display` for type `{}` instead", self_type.to_string()),
+            &format!("implement trait `Display` for type `{}` instead", self_type),
         );
     }
 }