diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-01-23 00:47:17 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2015-01-24 09:14:57 +0200 |
| commit | ab5c3303bf607df944e2fb814800db61bf62663e (patch) | |
| tree | 31cff97708634cf06bd37e990455910369c97457 | |
| parent | b7930d93d9b57beaeabfeb43cf78fc8161ecd46c (diff) | |
| download | rust-ab5c3303bf607df944e2fb814800db61bf62663e.tar.gz rust-ab5c3303bf607df944e2fb814800db61bf62663e.zip | |
str: make replace() example more simple
| -rw-r--r-- | src/libcollections/str.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 6608d0ee9a7..fc8b9727cbb 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -435,12 +435,9 @@ pub trait StrExt: Index<FullRange, 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); |
