Skip to content

Commit d87b039

Browse files
committed
Add pathbuf_from_cow_path
1 parent ea8131d commit d87b039

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libstd/path.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,14 @@ impl<'a> From<&'a PathBuf> for Cow<'a, Path> {
15401540
}
15411541
}
15421542

1543+
#[stable(feature = "pathbuf_from_cow_path", since = "1.28.0")]
1544+
impl<'a> From<Cow<'a, Path>> for PathBuf {
1545+
#[inline]
1546+
fn from(p: Cow<'a, Path>) -> Self {
1547+
p.into_owned()
1548+
}
1549+
}
1550+
15431551
#[stable(feature = "shared_from_slice2", since = "1.24.0")]
15441552
impl From<PathBuf> for Arc<Path> {
15451553
#[inline]

0 commit comments

Comments
 (0)