Clearer naming

This commit is contained in:
Aleksey Kladov 2021-04-06 16:22:26 +03:00
parent ad02bfe58f
commit 9ec5e6e4fd
3 changed files with 47 additions and 29 deletions

View file

@ -1,6 +1,7 @@
//! Thin wrappers around `std::path`, distinguishing between absolute and
//! relative paths.
use std::{
borrow::Borrow,
convert::{TryFrom, TryInto},
ops,
path::{Component, Path, PathBuf},
@ -35,6 +36,12 @@ impl AsRef<AbsPath> for AbsPathBuf {
}
}
impl Borrow<AbsPath> for AbsPathBuf {
fn borrow(&self) -> &AbsPath {
self.as_path()
}
}
impl TryFrom<PathBuf> for AbsPathBuf {
type Error = PathBuf;
fn try_from(path_buf: PathBuf) -> Result<AbsPathBuf, PathBuf> {