fix: path display error when start with crate

This commit is contained in:
Dezhi Wu 2021-09-07 14:44:30 +08:00
parent 86ebc36fa3
commit 82ae228d98
2 changed files with 20 additions and 1 deletions

View file

@ -1154,7 +1154,7 @@ impl HirDisplay for Path {
}
for (seg_idx, segment) in self.segments().iter().enumerate() {
if seg_idx != 0 {
if seg_idx != 0 || matches!(self.kind(), PathKind::Crate) {
write!(f, "::")?;
}
write!(f, "{}", segment.name)?;