Skip to content

Commit

Permalink
implement AsMut<str> for String
Browse files Browse the repository at this point in the history
  • Loading branch information
tspiteri committed Feb 1, 2020
1 parent 64184a3 commit fd22823
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,14 @@ impl AsRef<str> for String {
}
}

#[stable(feature = "string_as_mut", since = "1.43.0")]
impl AsMut<str> for String {
#[inline]
fn as_mut(&mut self) -> &mut str {
self
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl AsRef<[u8]> for String {
#[inline]
Expand Down

0 comments on commit fd22823

Please sign in to comment.