Rollup merge of #68742 - tspiteri:string-as-mut, r=sfackler

implement AsMut<str> for String

Closes #68741.
This commit is contained in:
Jonas Schievink 2020-02-09 18:23:30 +01:00 committed by GitHub
commit 3516df3ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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]