diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs index 39dfd98ddccfb..d5ed2c4adf4f1 100644 --- a/library/alloc/src/str.rs +++ b/library/alloc/src/str.rs @@ -271,6 +271,7 @@ impl str { /// let s = "this is old"; /// /// assert_eq!("this is new", s.replace("old", "new")); + /// assert_eq!("than an old", s.replace("is", "an")); /// ``` /// /// When the pattern doesn't match: