diff --git a/src/liballoc/str.rs b/src/liballoc/str.rs index 5f0b4088fc0..a167b2e57c0 100644 --- a/src/liballoc/str.rs +++ b/src/liballoc/str.rs @@ -363,16 +363,16 @@ impl str { /// # Examples /// /// ``` - /// let mut v = String::from("🗻∈🌏"); + /// let v = String::from("🗻∈🌏"); /// /// assert_eq!(Some("🗻"), v.get(0..4)); /// /// // indices not on UTF-8 sequence boundaries - /// assert!(v.get_mut(1..).is_none()); - /// assert!(v.get_mut(..8).is_none()); + /// assert!(v.get(1..).is_none()); + /// assert!(v.get(..8).is_none()); /// /// // out of bounds - /// assert!(v.get_mut(..42).is_none()); + /// assert!(v.get(..42).is_none()); /// ``` #[stable(feature = "str_checked_slicing", since = "1.20.0")] #[inline]