]> git.lizzy.rs Git - rust.git/commitdiff
Remove `collect`
authorRoc Yu <rocyu@protonmail.com>
Sat, 15 Jan 2022 23:06:45 +0000 (18:06 -0500)
committerRoc Yu <rocyu@protonmail.com>
Sat, 15 Jan 2022 23:06:45 +0000 (18:06 -0500)
src/librustdoc/core.rs

index 22f59d39799c4fbb56353affc95856af16f2ea47..ce7c62b0f2518c4a7999cf876a2484bf719528a0 100644 (file)
@@ -492,9 +492,9 @@ fn visit_path(&mut self, path: &'tcx Path<'_>, _id: HirId) {
                 "could not resolve path `{}`",
                 path.segments
                     .iter()
-                    .map(|segment| segment.ident.as_str().to_string())
-                    .collect::<Vec<_>>()
-                    .join("::")
+                    .map(|segment| segment.ident.as_str())
+                    .intersperse("::")
+                    .collect::<String>()
             );
             let mut err = rustc_errors::struct_span_err!(
                 self.tcx.sess,