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.
2 parents 310d771 + bc1a4c6 commit 41b0761Copy full SHA for 41b0761
src/liballoc/string.rs
@@ -759,7 +759,22 @@ impl String {
759
self
760
}
761
762
- /// Extracts a string slice containing the entire string.
+ /// Converts a `String` into a mutable string slice.
763
+ ///
764
+ /// # Examples
765
766
+ /// Basic usage:
767
768
+ /// ```
769
+ /// use std::ascii::AsciiExt;
770
771
+ /// let mut s = String::from("foobar");
772
+ /// let s_mut_str = s.as_mut_str();
773
774
+ /// s_mut_str.make_ascii_uppercase();
775
776
+ /// assert_eq!("FOOBAR", s_mut_str);
777
778
#[inline]
779
#[stable(feature = "string_as_str", since = "1.7.0")]
780
pub fn as_mut_str(&mut self) -> &mut str {
0 commit comments