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.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/vfs/src/vfs_path.rs b/crates/vfs/src/vfs_path.rs index 39a1666421..c4ecc9bb05 100644 --- a/crates/vfs/src/vfs_path.rs +++ b/crates/vfs/src/vfs_path.rs @@ -25,6 +25,12 @@ impl VfsPath { VfsPath(VfsPathRepr::VirtualPath(VirtualPath(path))) } + /// Create a path from string. Input should be a string representation of + /// an absolute path inside filesystem + pub fn new_real_path(path: String) -> VfsPath { + VfsPath::from(AbsPathBuf::assert(path.into())) + } + /// Returns the `AbsPath` representation of `self` if `self` is on the file system. pub fn as_path(&self) -> Option<&AbsPath> { match &self.0 { |