Skip to content

Commit

Permalink
auto merge of #19369 : seanmonstar/rust/cow-str, r=alexcrichton
Browse files Browse the repository at this point in the history
This implementation existed on MaybeOwned, but has been lost in the
transition to Cows. Let's put it back.

@aturon r?
  • Loading branch information
bors committed Nov 30, 2014
2 parents dfaad04 + 759032e commit 52888a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcollections/str.rs
Expand Up @@ -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
*/
Expand Down

0 comments on commit 52888a7

Please sign in to comment.