Skip to content

Commit 880af42

Browse files
committed
fix path wrong display
1 parent 6d2154e commit 880af42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/hir_ty/src/display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ impl HirDisplay for Path {
11411141
write!(f, ">")?;
11421142
}
11431143
(_, PathKind::Plain) => {}
1144-
(_, PathKind::Abs) => write!(f, "::")?,
1144+
(_, PathKind::Abs) => write!(f, "")?,
11451145
(_, PathKind::Crate) => write!(f, "crate")?,
11461146
(_, PathKind::Super(0)) => write!(f, "self")?,
11471147
(_, PathKind::Super(n)) => {
@@ -1154,7 +1154,7 @@ impl HirDisplay for Path {
11541154
}
11551155

11561156
for (seg_idx, segment) in self.segments().iter().enumerate() {
1157-
if seg_idx != 0 || matches!(self.kind(), PathKind::Crate) {
1157+
if !matches!(self.kind(), PathKind::Plain) || seg_idx > 0 {
11581158
write!(f, "::")?;
11591159
}
11601160
write!(f, "{}", segment.name)?;

0 commit comments

Comments
 (0)