feat(tvix/castore/path): impl AsRef<Path> for Path
This allows using both Path and PathBuf in a function argument taking `impl AsRef<Path>`. Change-Id: Ibd3ba6fac538069d2fe729d1ef399fdef301668f Reviewed-on: https://cl.tvl.fyi/c/depot/+/11574 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Connor Brewster <cbrewster@hey.com>
This commit is contained in:
parent
ea7b334a62
commit
3a9432f4d8
1 changed files with 6 additions and 0 deletions
|
@ -117,6 +117,12 @@ impl Display for Path {
|
|||
}
|
||||
}
|
||||
|
||||
impl AsRef<Path> for Path {
|
||||
fn as_ref(&self) -> &Path {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a owned PathBuf in the castore model.
|
||||
/// These are always relative, and platform-independent, which distinguishes
|
||||
/// them from the ones provided in the standard library.
|
||||
|
|
Loading…
Reference in a new issue