diff options
Diffstat (limited to 'crates/paths/src')
-rw-r--r-- | crates/paths/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/paths/src/lib.rs b/crates/paths/src/lib.rs index 22011cb33..f09ad37e3 100644 --- a/crates/paths/src/lib.rs +++ b/crates/paths/src/lib.rs | |||
@@ -1,6 +1,7 @@ | |||
1 | //! Thin wrappers around `std::path`, distinguishing between absolute and | 1 | //! Thin wrappers around `std::path`, distinguishing between absolute and |
2 | //! relative paths. | 2 | //! relative paths. |
3 | use std::{ | 3 | use std::{ |
4 | borrow::Borrow, | ||
4 | convert::{TryFrom, TryInto}, | 5 | convert::{TryFrom, TryInto}, |
5 | ops, | 6 | ops, |
6 | path::{Component, Path, PathBuf}, | 7 | path::{Component, Path, PathBuf}, |
@@ -35,6 +36,12 @@ impl AsRef<AbsPath> for AbsPathBuf { | |||
35 | } | 36 | } |
36 | } | 37 | } |
37 | 38 | ||
39 | impl Borrow<AbsPath> for AbsPathBuf { | ||
40 | fn borrow(&self) -> &AbsPath { | ||
41 | self.as_path() | ||
42 | } | ||
43 | } | ||
44 | |||
38 | impl TryFrom<PathBuf> for AbsPathBuf { | 45 | impl TryFrom<PathBuf> for AbsPathBuf { |
39 | type Error = PathBuf; | 46 | type Error = PathBuf; |
40 | fn try_from(path_buf: PathBuf) -> Result<AbsPathBuf, PathBuf> { | 47 | fn try_from(path_buf: PathBuf) -> Result<AbsPathBuf, PathBuf> { |