summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/clippy_lints/src/methods/wrong_self_convention.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tools/clippy/clippy_lints/src/methods/wrong_self_convention.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/tools/clippy/clippy_lints/src/methods/wrong_self_convention.rs b/src/tools/clippy/clippy_lints/src/methods/wrong_self_convention.rs
index 4b368d3ff..1fbf783b8 100644
--- a/src/tools/clippy/clippy_lints/src/methods/wrong_self_convention.rs
+++ b/src/tools/clippy/clippy_lints/src/methods/wrong_self_convention.rs
@@ -61,20 +61,20 @@ impl Convention {
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())