From 05af4213b593de5e6b73d8dda0eedf54b4568266 Mon Sep 17 00:00:00 2001 From: Yaulendil Date: Mon, 21 Dec 2020 18:42:29 -0500 Subject: [PATCH] Implement `AsMut` for `str` --- library/core/src/convert/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 3f7110b34cc6..d8c2e0b2a3bf 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -623,6 +623,14 @@ impl AsRef for str { } } +#[stable(feature = "as_mut_str_for_str", since = "1.50.0")] +impl AsMut for str { + #[inline] + fn as_mut(&mut self) -> &mut str { + self + } +} + //////////////////////////////////////////////////////////////////////////////// // THE NO-ERROR ERROR TYPE ////////////////////////////////////////////////////////////////////////////////