mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
fix path wrong display
This commit is contained in:
parent
6d2154e409
commit
880af425d4
@ -1141,7 +1141,7 @@ impl HirDisplay for Path {
|
|||||||
write!(f, ">")?;
|
write!(f, ">")?;
|
||||||
}
|
}
|
||||||
(_, PathKind::Plain) => {}
|
(_, PathKind::Plain) => {}
|
||||||
(_, PathKind::Abs) => write!(f, "::")?,
|
(_, PathKind::Abs) => write!(f, "")?,
|
||||||
(_, PathKind::Crate) => write!(f, "crate")?,
|
(_, PathKind::Crate) => write!(f, "crate")?,
|
||||||
(_, PathKind::Super(0)) => write!(f, "self")?,
|
(_, PathKind::Super(0)) => write!(f, "self")?,
|
||||||
(_, PathKind::Super(n)) => {
|
(_, PathKind::Super(n)) => {
|
||||||
@ -1154,7 +1154,7 @@ impl HirDisplay for Path {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (seg_idx, segment) in self.segments().iter().enumerate() {
|
for (seg_idx, segment) in self.segments().iter().enumerate() {
|
||||||
if seg_idx != 0 || matches!(self.kind(), PathKind::Crate) {
|
if !matches!(self.kind(), PathKind::Plain) || seg_idx > 0 {
|
||||||
write!(f, "::")?;
|
write!(f, "::")?;
|
||||||
}
|
}
|
||||||
write!(f, "{}", segment.name)?;
|
write!(f, "{}", segment.name)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user