about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-21 17:26:39 +0000
committerbors <bors@rust-lang.org>2023-06-21 17:26:39 +0000
commitae22869e36e04c8b791990c800e35230c2dc772f (patch)
tree81562f5f7cf0e971ff007d8d8b03dbd3770d6888
parentfe43be5d9bc7ff0254ec14075aac6b02f073daf8 (diff)
parentf5876aee1e7457961c4b0e1090789845768b876a (diff)
downloadrust-ae22869e36e04c8b791990c800e35230c2dc772f.tar.gz
rust-ae22869e36e04c8b791990c800e35230c2dc772f.zip
Auto merge of #15100 - lnicola:vfs-path-fmt, r=Veykril
internal: Simplify `VfsPath` `fmt` impls

Fixes https://github.com/rust-lang/rust-analyzer/pull/15097#discussion_r1236169290
-rw-r--r--crates/vfs/src/vfs_path.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs
index f88881488a6..52ada32bdfd 100644
--- a/crates/vfs/src/vfs_path.rs
+++ b/crates/vfs/src/vfs_path.rs
@@ -292,8 +292,8 @@ impl From<AbsPathBuf> for VfsPath {
 impl fmt::Display for VfsPath {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         match &self.0 {
-            VfsPathRepr::PathBuf(it) => fmt::Display::fmt(&it, f),
-            VfsPathRepr::VirtualPath(VirtualPath(it)) => fmt::Display::fmt(it, f),
+            VfsPathRepr::PathBuf(it) => it.fmt(f),
+            VfsPathRepr::VirtualPath(VirtualPath(it)) => it.fmt(f),
         }
     }
 }
@@ -307,8 +307,8 @@ impl fmt::Debug for VfsPath {
 impl fmt::Debug for VfsPathRepr {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match &self {
-            VfsPathRepr::PathBuf(it) => fmt::Debug::fmt(&it, f),
-            VfsPathRepr::VirtualPath(VirtualPath(it)) => fmt::Debug::fmt(&it, f),
+            VfsPathRepr::PathBuf(it) => it.fmt(f),
+            VfsPathRepr::VirtualPath(VirtualPath(it)) => it.fmt(f),
         }
     }
 }