mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-24 19:12:55 +00:00
Clearer naming
This commit is contained in:
parent
ad02bfe58f
commit
9ec5e6e4fd
3 changed files with 47 additions and 29 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue