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:
commit
52888a7c47
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user