Skip to content

Commit 4c25687

Browse files
committed
rollup merge of #21528: tshepang/simpler-replace-example
2 parents f6dd25b + ab5c330 commit 4c25687

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/libcollections/str.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,9 @@ pub trait StrExt: Index<RangeFull, Output = str> {
444444
/// # Examples
445445
///
446446
/// ```rust
447-
/// let s = "Do you know the muffin man,
448-
/// The muffin man, the muffin man, ...".to_string();
447+
/// let s = "this is old";
449448
///
450-
/// assert_eq!(s.replace("muffin man", "little lamb"),
451-
/// "Do you know the little lamb,
452-
/// The little lamb, the little lamb, ...".to_string());
449+
/// assert_eq!(s.replace("old", "new"), "this is new");
453450
///
454451
/// // not found, so no change.
455452
/// assert_eq!(s.replace("cookie monster", "little lamb"), s);

0 commit comments

Comments
 (0)