Implement From for more types on Cow

This commit is contained in:
George Burton
2018-04-22 22:57:52 +01:00
parent ff48277add
commit 1133a149f1
5 changed files with 71 additions and 0 deletions

View File

@@ -1532,6 +1532,14 @@ impl<'a> From<PathBuf> for Cow<'a, Path> {
}
}
#[stable(feature = "cow_from_pathbuf_ref", since = "1.28.0")]
impl<'a> From<&'a PathBuf> for Cow<'a, Path> {
#[inline]
fn from(p: &'a PathBuf) -> Cow<'a, Path> {
Cow::Borrowed(p.as_path())
}
}
#[stable(feature = "shared_from_slice2", since = "1.24.0")]
impl From<PathBuf> for Arc<Path> {
#[inline]