]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/casts/cast_lossless.rs
Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / casts / cast_lossless.rs
index 938458e30cadc6082697568ebdd7a9a413ebfa4d..13c403234dad5e8b44a41dfe87b99a5f24d25b4b 100644 (file)
@@ -41,15 +41,9 @@ pub(super) fn check(
     );
 
     let message = if cast_from.is_bool() {
-        format!(
-            "casting `{0:}` to `{1:}` is more cleanly stated with `{1:}::from(_)`",
-            cast_from, cast_to
-        )
+        format!("casting `{cast_from:}` to `{cast_to:}` is more cleanly stated with `{cast_to:}::from(_)`")
     } else {
-        format!(
-            "casting `{}` to `{}` may become silently lossy if you later change the type",
-            cast_from, cast_to
-        )
+        format!("casting `{cast_from}` to `{cast_to}` may become silently lossy if you later change the type")
     };
 
     span_lint_and_sugg(
@@ -58,7 +52,7 @@ pub(super) fn check(
         expr.span,
         &message,
         "try",
-        format!("{}::from({})", cast_to, sugg),
+        format!("{cast_to}::from({sugg})"),
         applicability,
     );
 }