]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/methods/map_flatten.rs
Auto merge of #99422 - Dylan-DPC:rollup-htjofm6, r=Dylan-DPC
[rust.git] / src / tools / clippy / clippy_lints / src / methods / map_flatten.rs
index 8ae84dbb3dcf432b056e9c9649db60c5a543bfb7..13853dec99de8970293790ffd481d030016bda51 100644 (file)
 pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, recv: &Expr<'_>, map_arg: &Expr<'_>, map_span: Span) {
     if let Some((caller_ty_name, method_to_use)) = try_get_caller_ty_name_and_method_name(cx, expr, recv, map_arg) {
         let mut applicability = Applicability::MachineApplicable;
-        
+
         let closure_snippet = snippet_with_applicability(cx, map_arg.span, "..", &mut applicability);
         span_lint_and_sugg(
             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!(
+                "try replacing `map` with `{}` and remove the `.flatten()`",
+                method_to_use
+            ),
             format!("{}({})", method_to_use, closure_snippet),
             applicability,
         );