]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/methods/wrong_self_convention.rs
Rollup merge of #105829 - the8472:tidy-style, r=jyn514
[rust.git] / src / tools / clippy / clippy_lints / src / methods / wrong_self_convention.rs
index 4b368d3ffae254abd04ba4727b7b30faed484ef3..1fbf783b8860e1d701f1801cf9ddf272bad3b288 100644 (file)
@@ -61,20 +61,20 @@ fn check<'tcx>(
 impl fmt::Display for Convention {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
         match *self {
-            Self::Eq(this) => format!("`{}`", this).fmt(f),
-            Self::StartsWith(this) => format!("`{}*`", this).fmt(f),
-            Self::EndsWith(this) => format!("`*{}`", this).fmt(f),
-            Self::NotEndsWith(this) => format!("`~{}`", this).fmt(f),
+            Self::Eq(this) => format!("`{this}`").fmt(f),
+            Self::StartsWith(this) => format!("`{this}*`").fmt(f),
+            Self::EndsWith(this) => format!("`*{this}`").fmt(f),
+            Self::NotEndsWith(this) => format!("`~{this}`").fmt(f),
             Self::IsSelfTypeCopy(is_true) => {
                 format!("`self` type is{} `Copy`", if is_true { "" } else { " not" }).fmt(f)
             },
             Self::ImplementsTrait(is_true) => {
                 let (negation, s_suffix) = if is_true { ("", "s") } else { (" does not", "") };
-                format!("method{} implement{} a trait", negation, s_suffix).fmt(f)
+                format!("method{negation} implement{s_suffix} a trait").fmt(f)
             },
             Self::IsTraitItem(is_true) => {
                 let suffix = if is_true { " is" } else { " is not" };
-                format!("method{} a trait item", suffix).fmt(f)
+                format!("method{suffix} a trait item").fmt(f)
             },
         }
     }
@@ -138,8 +138,7 @@ pub(super) fn check<'tcx>(
                 WRONG_SELF_CONVENTION,
                 first_arg_span,
                 &format!(
-                    "{} usually take {}",
-                    suggestion,
+                    "{suggestion} usually take {}",
                     &self_kinds
                         .iter()
                         .map(|k| k.description())