From 7c861cf0adb5e2d4d457105d78c0f37b801715ab Mon Sep 17 00:00:00 2001 From: bvanjoi Date: Fri, 10 Jun 2022 00:28:46 +0800 Subject: [PATCH] additional docs example for replace **all** of str --- library/alloc/src/str.rs | 1 + 1 file changed, 1 insertion(+) 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: