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.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs
index c35b7f229f..7e2c787afc 100644
--- a/crates/vfs/src/vfs_path.rs
+++ b/crates/vfs/src/vfs_path.rs
@@ -39,6 +39,13 @@ impl VfsPath {
}
}
+ pub fn into_abs_path(self) -> Option<AbsPathBuf> {
+ match self.0 {
+ VfsPathRepr::PathBuf(it) => Some(it),
+ VfsPathRepr::VirtualPath(_) => None,
+ }
+ }
+
/// Creates a new `VfsPath` with `path` adjoined to `self`.
pub fn join(&self, path: &str) -> Option<VfsPath> {
match &self.0 {