]> git.lizzy.rs Git - rust.git/blobdiff - library/alloc/src/str.rs
additional docs example for replace **all** of str
[rust.git] / library / alloc / src / str.rs
index 39dfd98ddccfb8aef35fd13a1379d3dfaeaad797..d5ed2c4adf4f14532afd840ac73451ca2de8d81f 100644 (file)
@@ -271,6 +271,7 @@ pub fn into_boxed_bytes(self: Box<str>) -> Box<[u8]> {
     /// 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: