implement AsMut<str> for String

This commit is contained in:
Trevor Spiteri 2020-02-01 22:19:28 +01:00
parent 64184a3288
commit fd22823881

View File

@ -2208,6 +2208,14 @@ fn as_ref(&self) -> &str {
}
}
#[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]