about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-30 12:08:36 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-30 13:26:43 -0800
commit4c25687c2bf8d83f1e26bd6aad6d2eb807c5b254 (patch)
tree787add13fea32dbd27056fd59303f02f39c9b3b1
parentf6dd25bb380880b377bbe654158e85976c891f9b (diff)
parentab5c3303bf607df944e2fb814800db61bf62663e (diff)
downloadrust-4c25687c2bf8d83f1e26bd6aad6d2eb807c5b254.tar.gz
rust-4c25687c2bf8d83f1e26bd6aad6d2eb807c5b254.zip
rollup merge of #21528: tshepang/simpler-replace-example
-rw-r--r--src/libcollections/str.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs
index f6ba2b0ebaf..ded6385d293 100644
--- a/src/libcollections/str.rs
+++ b/src/libcollections/str.rs
@@ -444,12 +444,9 @@ pub trait StrExt: Index<RangeFull, Output = str> {
     /// # 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);