about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcollections/str.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs
index ebd30d758f2..c6fa1332186 100644
--- a/src/libcollections/str.rs
+++ b/src/libcollections/str.rs
@@ -656,6 +656,13 @@ Section: CowString
 /// A clone-on-write string
 pub type CowString<'a> = Cow<'a, String, str>;
 
+impl<'a> Str for CowString<'a> {
+    #[inline]
+    fn as_slice<'b>(&'b self) -> &'b str {
+        (**self).as_slice()
+    }
+}
+
 /*
 Section: Trait implementations
 */