aboutsummaryrefslogtreecommitdiff
path: root/crates/paths/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-04-06 14:22:26 +0100
committerAleksey Kladov <[email protected]>2021-04-06 14:22:26 +0100
commit9ec5e6e4fdbe893f38d10dbdc609284368efdb64 (patch)
tree959faf13c99465ae23ff0bb1fd67b0a3b246c5bd /crates/paths/src
parentad02bfe58fd52293d9ae4a049f98f475df9d3abb (diff)
Clearer naming
Diffstat (limited to 'crates/paths/src')
-rw-r--r--crates/paths/src/lib.rs7
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.
3use std::{ 3use 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
39impl Borrow<AbsPath> for AbsPathBuf {
40 fn borrow(&self) -> &AbsPath {
41 self.as_path()
42 }
43}
44
38impl TryFrom<PathBuf> for AbsPathBuf { 45impl 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> {