Canonicalize rust-project.json manifest path

This commit is contained in:
Lukas Wirth 2023-03-27 21:55:02 +02:00
parent 284c1741d6
commit f1de133820
3 changed files with 12 additions and 7 deletions

View file

@ -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 {