Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/project-model/src/manifest_path.rs')
| -rw-r--r-- | crates/project-model/src/manifest_path.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/project-model/src/manifest_path.rs b/crates/project-model/src/manifest_path.rs index 980d92d3df..d6754116e6 100644 --- a/crates/project-model/src/manifest_path.rs +++ b/crates/project-model/src/manifest_path.rs @@ -34,6 +34,11 @@ impl ManifestPath { pub fn parent(&self) -> &AbsPath { self.file.parent().unwrap() } + + /// Equivalent of [`Path::canonicalize`] for `ManifestPath`. + pub fn canonicalize(&self) -> Result<ManifestPath, std::io::Error> { + Ok((&**self).canonicalize()?.try_into().unwrap()) + } } impl ops::Deref for ManifestPath { |