Skip to content

Commit ae22869

Browse files
committed
Auto merge of rust-lang#15100 - lnicola:vfs-path-fmt, r=Veykril
internal: Simplify `VfsPath` `fmt` impls Fixes rust-lang/rust-analyzer#15097 (comment)
2 parents fe43be5 + f5876ae commit ae22869

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/vfs/src/vfs_path.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ impl From<AbsPathBuf> for VfsPath {
292292
impl fmt::Display for VfsPath {
293293
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
294294
match &self.0 {
295-
VfsPathRepr::PathBuf(it) => fmt::Display::fmt(&it, f),
296-
VfsPathRepr::VirtualPath(VirtualPath(it)) => fmt::Display::fmt(it, f),
295+
VfsPathRepr::PathBuf(it) => it.fmt(f),
296+
VfsPathRepr::VirtualPath(VirtualPath(it)) => it.fmt(f),
297297
}
298298
}
299299
}
@@ -307,8 +307,8 @@ impl fmt::Debug for VfsPath {
307307
impl fmt::Debug for VfsPathRepr {
308308
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
309309
match &self {
310-
VfsPathRepr::PathBuf(it) => fmt::Debug::fmt(&it, f),
311-
VfsPathRepr::VirtualPath(VirtualPath(it)) => fmt::Debug::fmt(&it, f),
310+
VfsPathRepr::PathBuf(it) => it.fmt(f),
311+
VfsPathRepr::VirtualPath(VirtualPath(it)) => it.fmt(f),
312312
}
313313
}
314314
}

0 commit comments

Comments
 (0)