Fix implementation of clean::Path::whole_name()
I think that before this commit, the path `::std::vec::Vec` would have rendered as `{{root}}::std::vec::Vec`. Now, it should render correctly as `::std::vec::Vec`.
This commit is contained in:
parent
f359b316df
commit
ebbcafbfa3
@ -1958,7 +1958,11 @@ impl Path {
|
||||
}
|
||||
|
||||
crate fn whole_name(&self) -> String {
|
||||
self.segments.iter().map(|s| s.name.to_string()).intersperse("::".into()).collect()
|
||||
self.segments
|
||||
.iter()
|
||||
.map(|s| if s.name == kw::PathRoot { String::new() } else { s.name.to_string() })
|
||||
.intersperse("::".into())
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Checks if this is a `T::Name` path for an associated type.
|
||||
|
Loading…
Reference in New Issue
Block a user