mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
impl Str for CowString
This implementation existed on MaybeOwned, but has been lost in the transition to Cows. Let's put it back.
This commit is contained in:
parent
82fc1aa875
commit
759032ee64
@ -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