diff options
| author | Matt Ickstadt <mattico8@gmail.com> | 2017-08-22 15:24:25 -0500 |
|---|---|---|
| committer | Matt Ickstadt <mattico8@gmail.com> | 2017-08-26 15:07:32 -0500 |
| commit | 0c3c43c8005555f910b678b861ff4660c874199d (patch) | |
| tree | 9142b6fce1d7b8641890c905ed61ea7f0515f4db /src/liballoc/tests/string.rs | |
| parent | a24e0f25d7a0ac793b37eb4db353d5f9f2befc97 (diff) | |
| download | rust-0c3c43c8005555f910b678b861ff4660c874199d.tar.gz rust-0c3c43c8005555f910b678b861ff4660c874199d.zip | |
Remove Splice struct return value from String::splice
Diffstat (limited to 'src/liballoc/tests/string.rs')
| -rw-r--r-- | src/liballoc/tests/string.rs | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/liballoc/tests/string.rs b/src/liballoc/tests/string.rs index f5c124c6b44..6aba18ddf49 100644 --- a/src/liballoc/tests/string.rs +++ b/src/liballoc/tests/string.rs @@ -442,9 +442,8 @@ fn test_drain() { #[test] fn test_splice() { let mut s = "Hello, world!".to_owned(); - let t: String = s.splice(7..12, "世界").collect(); + s.splice(7..12, "世界"); assert_eq!(s, "Hello, 世界!"); - assert_eq!(t, "world"); } #[test] @@ -457,12 +456,10 @@ fn test_splice_char_boundary() { #[test] fn test_splice_inclusive_range() { let mut v = String::from("12345"); - let t: String = v.splice(2...3, "789").collect(); + v.splice(2...3, "789"); assert_eq!(v, "127895"); - assert_eq!(t, "34"); - let t2: String = v.splice(1...2, "A").collect(); + v.splice(1...2, "A"); assert_eq!(v, "1A895"); - assert_eq!(t2, "27"); } #[test] @@ -482,24 +479,15 @@ fn test_splice_inclusive_out_of_bounds() { #[test] fn test_splice_empty() { let mut s = String::from("12345"); - let t: String = s.splice(1..2, "").collect(); + s.splice(1..2, ""); assert_eq!(s, "1345"); - assert_eq!(t, "2"); } #[test] fn test_splice_unbounded() { let mut s = String::from("12345"); - let t: String = s.splice(.., "").collect(); + s.splice(.., ""); assert_eq!(s, ""); - assert_eq!(t, "12345"); -} - -#[test] -fn test_splice_forget() { - let mut s = String::from("12345"); - ::std::mem::forget(s.splice(2..4, "789")); - assert_eq!(s, "12345"); } #[test] |
