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 */