diff options
| author | bors <bors@rust-lang.org> | 2014-05-01 16:06:48 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-01 16:06:48 -0700 |
| commit | 9f836d5a53e20fde65aa3469fa1826228e7c273a (patch) | |
| tree | 01a0c192a4dabd1ebb17f3d3da8662701d43c6f4 /src/libstd/str.rs | |
| parent | fb72d7cfea9ba44581f708b13aa82ab23ee4fa7e (diff) | |
| parent | e93cb04c4b011088d3b13a17bdf4cb865730dd38 (diff) | |
| download | rust-9f836d5a53e20fde65aa3469fa1826228e7c273a.tar.gz rust-9f836d5a53e20fde65aa3469fa1826228e7c273a.zip | |
auto merge of #13877 : thestinger/rust/de-tilde-str-vec, r=alexcrichton
Diffstat (limited to 'src/libstd/str.rs')
| -rw-r--r-- | src/libstd/str.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libstd/str.rs b/src/libstd/str.rs index bc7943dd777..b105dd0ca5a 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -2025,12 +2025,12 @@ pub trait StrSlice<'a> { /// # Example /// /// ```rust - /// let s = ~"Do you know the muffin man, - /// The muffin man, the muffin man, ..."; + /// let s = "Do you know the muffin man, + /// The muffin man, the muffin man, ...".to_owned(); /// /// assert_eq!(s.replace("muffin man", "little lamb"), - /// ~"Do you know the little lamb, - /// The little lamb, the little lamb, ..."); + /// "Do you know the little lamb, + /// The little lamb, the little lamb, ...".to_owned()); /// /// // not found, so no change. /// assert_eq!(s.replace("cookie monster", "little lamb"), s); @@ -3604,11 +3604,11 @@ mod tests { #[test] fn test_total_ord() { - "1234".cmp(& &"123") == Greater; - "123".cmp(& &"1234") == Less; - "1234".cmp(& &"1234") == Equal; - "12345555".cmp(& &"123456") == Less; - "22".cmp(& &"1234") == Greater; + "1234".cmp(&("123")) == Greater; + "123".cmp(&("1234")) == Less; + "1234".cmp(&("1234")) == Equal; + "12345555".cmp(&("123456")) == Less; + "22".cmp(&("1234")) == Greater; } #[test] @@ -4005,7 +4005,7 @@ mod tests { #[test] fn test_from_str() { - let owned: Option<~str> = from_str(&"string"); + let owned: Option<~str> = from_str("string"); assert_eq!(owned, Some("string".to_owned())); } |
