From 746331caff62b65466fcc630c04e6e9ff0ac8404 Mon Sep 17 00:00:00 2001 From: Newton Ni Date: Wed, 4 Mar 2020 10:34:05 -0500 Subject: [PATCH] Implement AsMut for String --- src/liballoc/string.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index f5afea15d655e..64f6fd3a8ff9c 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -2209,6 +2209,14 @@ impl AsMut for String { } } +#[stable(feature = "string_as_mut", since = "1.43.0")] +impl AsMut for String { + #[inline] + fn as_mut(&mut self) -> &mut String { + self + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl AsRef<[u8]> for String { #[inline]