From 9ec5e6e4fdbe893f38d10dbdc609284368efdb64 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Apr 2021 16:22:26 +0300 Subject: Clearer naming --- crates/paths/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/paths') 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 @@ //! 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 for AbsPathBuf { } } +impl Borrow for AbsPathBuf { + fn borrow(&self) -> &AbsPath { + self.as_path() + } +} + impl TryFrom for AbsPathBuf { type Error = PathBuf; fn try_from(path_buf: PathBuf) -> Result { -- cgit v1.2.3