diff options
| author | George Burton <burtonageo@gmail.com> | 2018-04-27 20:41:00 +0100 |
|---|---|---|
| committer | George Burton <burtonageo@gmail.com> | 2018-04-27 20:41:00 +0100 |
| commit | d87b039ea61b5be401f855b6ab788ddd6e04c847 (patch) | |
| tree | 0a40f1591f24bece22a31ae9903d92cea774d0ba /src/libstd | |
| parent | ea8131de53a7aa587938106cfb5b0ec77b127bca (diff) | |
| download | rust-d87b039ea61b5be401f855b6ab788ddd6e04c847.tar.gz rust-d87b039ea61b5be401f855b6ab788ddd6e04c847.zip | |
Add pathbuf_from_cow_path
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 19f38e4d6d9..b7ab14b29ca 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1540,6 +1540,14 @@ impl<'a> From<&'a PathBuf> for Cow<'a, Path> { } } +#[stable(feature = "pathbuf_from_cow_path", since = "1.28.0")] +impl<'a> From<Cow<'a, Path>> for PathBuf { + #[inline] + fn from(p: Cow<'a, Path>) -> Self { + p.into_owned() + } +} + #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<PathBuf> for Arc<Path> { #[inline] |
