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:
Florian Klink 2024-05-01 20:22:06 +03:00 committed by clbot
parent ea7b334a62
commit 3a9432f4d8

View file

@ -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.