auto merge of #19369 : seanmonstar/rust/cow-str, r=alexcrichton

This implementation existed on MaybeOwned, but has been lost in the
transition to Cows. Let's put it back.

@aturon r?
This commit is contained in:
bors 2014-11-30 10:21:49 +00:00
commit 52888a7c47
1 changed files with 7 additions and 0 deletions

View File

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