diff options
| author | bors <bors@rust-lang.org> | 2015-01-14 04:42:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-14 04:42:01 +0000 |
| commit | 3614e1de6cf7abc7754c23f93476bef0e2625e99 (patch) | |
| tree | e36aa17f7450d9f0007d7278e244ba6d8127b5cf /src/libcollections | |
| parent | 170c4399e614fe599c3d41306b3429ca8b3b68c6 (diff) | |
| parent | c1d48a85082cfe3683ad9eda5223d3259d4fa718 (diff) | |
| download | rust-3614e1de6cf7abc7754c23f93476bef0e2625e99.tar.gz rust-3614e1de6cf7abc7754c23f93476bef0e2625e99.zip | |
auto merge of #21061 : japaric/rust/range, r=nick29581
Diffstat (limited to 'src/libcollections')
| -rw-r--r-- | src/libcollections/slice.rs | 12 | ||||
| -rw-r--r-- | src/libcollections/str.rs | 2 | ||||
| -rw-r--r-- | src/libcollections/string.rs | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 9a1f22ef7a6..4812ecc2c0b 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -1631,7 +1631,7 @@ mod tests { #[test] fn test_slice_from() { let vec: &[int] = &[1, 2, 3, 4]; - assert_eq!(&vec[0..], vec); + assert_eq!(&vec[], vec); let b: &[int] = &[3, 4]; assert_eq!(&vec[2..], b); let b: &[int] = &[]; @@ -1641,11 +1641,11 @@ mod tests { #[test] fn test_slice_to() { let vec: &[int] = &[1, 2, 3, 4]; - assert_eq!(&vec[0..4], vec); + assert_eq!(&vec[..4], vec); let b: &[int] = &[1, 2]; - assert_eq!(&vec[0..2], b); + assert_eq!(&vec[..2], b); let b: &[int] = &[]; - assert_eq!(&vec[0..0], b); + assert_eq!(&vec[..0], b); } @@ -2538,7 +2538,7 @@ mod tests { let (left, right) = values.split_at_mut(2); { let left: &[_] = left; - assert!(left[0..left.len()] == [1, 2][]); + assert!(left[..left.len()] == [1, 2][]); } for p in left.iter_mut() { *p += 1; @@ -2546,7 +2546,7 @@ mod tests { { let right: &[_] = right; - assert!(right[0..right.len()] == [3, 4, 5][]); + assert!(right[..right.len()] == [3, 4, 5][]); } for p in right.iter_mut() { *p += 2; diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index ccf654ac0a0..96c73981e36 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -807,7 +807,7 @@ pub trait StrExt: Index<FullRange, Output = str> { /// out of bounds. /// /// See also `slice`, `slice_from` and `slice_chars`. - #[unstable = "use slice notation [0..a] instead"] + #[unstable = "use slice notation [..a] instead"] fn slice_to(&self, end: uint) -> &str { core_str::StrExt::slice_to(&self[], end) } diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index e30e7e8600d..c845d86ca0f 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -168,7 +168,7 @@ impl String { if i > 0 { unsafe { - res.as_mut_vec().push_all(&v[0..i]) + res.as_mut_vec().push_all(&v[..i]) }; } |
