]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/methods/map_flatten.rs
Auto merge of #105436 - nnethercote:inline-place_contents_drop_state_cannot_differ...
[rust.git] / src / tools / clippy / clippy_lints / src / methods / map_flatten.rs
index 13853dec99de8970293790ffd481d030016bda51..361ffcb5ef3fb2e9f93af8110ad60be7298b4d1c 100644 (file)
@@ -20,12 +20,9 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, recv: &Expr<'_>, map_
             cx,
             MAP_FLATTEN,
             expr.span.with_lo(map_span.lo()),
-            &format!("called `map(..).flatten()` on `{}`", caller_ty_name),
-            &format!(
-                "try replacing `map` with `{}` and remove the `.flatten()`",
-                method_to_use
-            ),
-            format!("{}({})", method_to_use, closure_snippet),
+            &format!("called `map(..).flatten()` on `{caller_ty_name}`"),
+            &format!("try replacing `map` with `{method_to_use}` and remove the `.flatten()`"),
+            format!("{method_to_use}({closure_snippet})"),
             applicability,
         );
     }