We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dee6d0f commit bc1a4c6Copy full SHA for bc1a4c6
src/liballoc/string.rs
@@ -749,7 +749,22 @@ impl String {
749
self
750
}
751
752
- /// Extracts a string slice containing the entire string.
+ /// Converts a `String` into a mutable string slice.
753
+ ///
754
+ /// # Examples
755
756
+ /// Basic usage:
757
758
+ /// ```
759
+ /// use std::ascii::AsciiExt;
760
761
+ /// let mut s = String::from("foobar");
762
+ /// let s_mut_str = s.as_mut_str();
763
764
+ /// s_mut_str.make_ascii_uppercase();
765
766
+ /// assert_eq!("FOOBAR", s_mut_str);
767
768
#[inline]
769
#[stable(feature = "string_as_str", since = "1.7.0")]
770
pub fn as_mut_str(&mut self) -> &mut str {
0 commit comments