about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGleb Kozyrev <gleb@gkoz.com>2016-02-18 16:04:28 +0200
committerGleb Kozyrev <gleb@gkoz.com>2016-02-18 16:04:28 +0200
commit27be4336d9dc0a829ca3c19e8b08a404b11b359d (patch)
tree3f7eae1328a9a81775c87c9d8275abcaab99221c /src
parent9fb4fcac8261a4ee328c6cfb06509916d5fa4108 (diff)
downloadrust-27be4336d9dc0a829ca3c19e8b08a404b11b359d.tar.gz
rust-27be4336d9dc0a829ca3c19e8b08a404b11b359d.zip
Impl AsRef<Path> for Cow<OsStr>
Diffstat (limited to 'src')
-rw-r--r--src/libstd/path.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 10ecaed3aef..97edb35e5b6 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -2002,6 +2002,13 @@ impl AsRef<Path> for OsStr {
     }
 }
 
+#[stable(feature = "cow_os_str_as_ref_path", since = "1.8.0")]
+impl<'a> AsRef<Path> for Cow<'a, OsStr> {
+    fn as_ref(&self) -> &Path {
+        Path::new(self)
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl AsRef<Path> for OsString {
     fn as_ref(&self) -> &Path {