about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-17 12:19:46 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2024-03-17 12:19:46 +0100
commitb8db431f37e097a545f364335fdcd5f65c056cb7 (patch)
treed31e84e330cb6e176e6933223df59768dead68d6
parentecdea9e9438cdb8cf707e7f60e066eda02344d05 (diff)
downloadrust-b8db431f37e097a545f364335fdcd5f65c056cb7.tar.gz
rust-b8db431f37e097a545f364335fdcd5f65c056cb7.zip
avoid unnecessary collect()
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/errors.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/errors.rs b/compiler/rustc_hir_analysis/src/astconv/errors.rs
index 37fbf45235a..68896768e8d 100644
--- a/compiler/rustc_hir_analysis/src/astconv/errors.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/errors.rs
@@ -408,10 +408,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
                              traits with associated type `{name}`, you could use the \
                              fully-qualified path",
                         ),
-                        traits
-                            .iter()
-                            .map(|trait_str| format!("<Example as {trait_str}>::{name}"))
-                            .collect::<Vec<_>>(),
+                        traits.iter().map(|trait_str| format!("<Example as {trait_str}>::{name}")),
                         Applicability::HasPlaceholders,
                     );
                 }