Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/vfs/src/vfs_path.rs')
-rw-r--r--crates/vfs/src/vfs_path.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs
index 92a49e0793..3c8e37413f 100644
--- a/crates/vfs/src/vfs_path.rs
+++ b/crates/vfs/src/vfs_path.rs
@@ -313,6 +313,20 @@ impl fmt::Debug for VfsPathRepr {
}
}
+impl PartialEq<AbsPath> for VfsPath {
+ fn eq(&self, other: &AbsPath) -> bool {
+ match &self.0 {
+ VfsPathRepr::PathBuf(lhs) => lhs == other,
+ VfsPathRepr::VirtualPath(_) => false,
+ }
+ }
+}
+impl PartialEq<VfsPath> for AbsPath {
+ fn eq(&self, other: &VfsPath) -> bool {
+ other == self
+ }
+}
+
/// `/`-separated virtual path.
///
/// This is used to describe files that do not reside on the file system.