Avoid intermediate collect()

This commit is contained in:
Noah Lev 2021-08-27 16:26:11 -07:00
parent a83112fe3e
commit eec21d2176

View file

@ -1955,7 +1955,7 @@ impl Path {
}
crate fn whole_name(&self) -> String {
self.segments.iter().map(|s| s.name.to_string()).collect::<Vec<_>>().join("::")
self.segments.iter().map(|s| s.name.to_string()).intersperse("::".into()).collect()
}
/// Checks if this is a `T::Name` path for an associated type.