diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index f6ba2b0ebaf9..ded6385d2932 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -444,12 +444,9 @@ pub trait StrExt: Index { /// # Examples /// /// ```rust - /// let s = "Do you know the muffin man, - /// The muffin man, the muffin man, ...".to_string(); + /// let s = "this is old"; /// - /// assert_eq!(s.replace("muffin man", "little lamb"), - /// "Do you know the little lamb, - /// The little lamb, the little lamb, ...".to_string()); + /// assert_eq!(s.replace("old", "new"), "this is new"); /// /// // not found, so no change. /// assert_eq!(s.replace("cookie monster", "little lamb"), s);