about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc/string.rs')
-rw-r--r--src/liballoc/string.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs
index c95f79472fe..0e48f1548e6 100644
--- a/src/liballoc/string.rs
+++ b/src/liballoc/string.rs
@@ -2225,6 +2225,17 @@ impl From<&str> for String {
     }
 }
 
+#[stable(feature = "from_mut_str_for_string", since = "1.44.0")]
+impl From<&mut str> for String {
+    /// Converts a `&mut str` into a `String`.
+    ///
+    /// The result is allocated on the heap.
+    #[inline]
+    fn from(s: &mut str) -> String {
+        s.to_owned()
+    }
+}
+
 #[stable(feature = "from_ref_string", since = "1.35.0")]
 impl From<&String> for String {
     #[inline]