From 7e2b9ea235c2bf4cc9a7575c8e0f70950208b8f2 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 30 Dec 2014 21:19:41 +1300 Subject: Fallout - change array syntax to use `;` --- src/libcollections/dlist.rs | 10 +++++----- src/libcollections/slice.rs | 21 +++++++++++---------- src/libcollections/str.rs | 4 ++-- src/libcollections/string.rs | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) (limited to 'src/libcollections') diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs index 82dabedd871..c4ebf436c97 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -1322,7 +1322,7 @@ mod tests { #[bench] fn bench_collect_into(b: &mut test::Bencher) { - let v = &[0i, ..64]; + let v = &[0i; 64]; b.iter(|| { let _: DList = v.iter().map(|x| *x).collect(); }) @@ -1384,7 +1384,7 @@ mod tests { #[bench] fn bench_iter(b: &mut test::Bencher) { - let v = &[0i, ..128]; + let v = &[0i; 128]; let m: DList = v.iter().map(|&x|x).collect(); b.iter(|| { assert!(m.iter().count() == 128); @@ -1392,7 +1392,7 @@ mod tests { } #[bench] fn bench_iter_mut(b: &mut test::Bencher) { - let v = &[0i, ..128]; + let v = &[0i; 128]; let mut m: DList = v.iter().map(|&x|x).collect(); b.iter(|| { assert!(m.iter_mut().count() == 128); @@ -1400,7 +1400,7 @@ mod tests { } #[bench] fn bench_iter_rev(b: &mut test::Bencher) { - let v = &[0i, ..128]; + let v = &[0i; 128]; let m: DList = v.iter().map(|&x|x).collect(); b.iter(|| { assert!(m.iter().rev().count() == 128); @@ -1408,7 +1408,7 @@ mod tests { } #[bench] fn bench_iter_mut_rev(b: &mut test::Bencher) { - let v = &[0i, ..128]; + let v = &[0i; 128]; let mut m: DList = v.iter().map(|&x|x).collect(); b.iter(|| { assert!(m.iter_mut().rev().count() == 128); diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 02b70c0f169..5f72fc69639 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -861,6 +861,7 @@ pub trait CloneSliceExt for Sized? { fn clone_from_slice(&mut self, &[T]) -> uint; } + #[unstable = "trait is unstable"] impl CloneSliceExt for [T] { /// Returns a copy of `v`. @@ -1482,14 +1483,14 @@ mod tests { #[test] fn test_is_empty() { - let xs: [int, ..0] = []; + let xs: [int; 0] = []; assert!(xs.is_empty()); assert!(![0i].is_empty()); } #[test] fn test_len_divzero() { - type Z = [i8, ..0]; + type Z = [i8; 0]; let v0 : &[Z] = &[]; let v1 : &[Z] = &[[]]; let v2 : &[Z] = &[[], []]; @@ -1856,7 +1857,7 @@ mod tests { #[test] fn test_permutations() { { - let v: [int, ..0] = []; + let v: [int; 0] = []; let mut it = v.permutations(); let (min_size, max_opt) = it.size_hint(); assert_eq!(min_size, 1); @@ -2116,28 +2117,28 @@ mod tests { #[test] fn test_concat() { - let v: [Vec, ..0] = []; + let v: [Vec; 0] = []; let c: Vec = v.concat(); assert_eq!(c, []); let d: Vec = [vec![1i], vec![2i,3i]].concat(); assert_eq!(d, vec![1i, 2, 3]); - let v: [&[int], ..2] = [&[1], &[2, 3]]; + let v: [&[int]; 2] = [&[1], &[2, 3]]; assert_eq!(v.connect(&0), vec![1i, 0, 2, 3]); - let v: [&[int], ..3] = [&[1i], &[2], &[3]]; + let v: [&[int]; 3] = [&[1i], &[2], &[3]]; assert_eq!(v.connect(&0), vec![1i, 0, 2, 0, 3]); } #[test] fn test_connect() { - let v: [Vec, ..0] = []; + let v: [Vec; 0] = []; assert_eq!(v.connect_vec(&0), vec![]); assert_eq!([vec![1i], vec![2i, 3]].connect_vec(&0), vec![1, 0, 2, 3]); assert_eq!([vec![1i], vec![2i], vec![3i]].connect_vec(&0), vec![1, 0, 2, 0, 3]); - let v: [&[int], ..2] = [&[1], &[2, 3]]; + let v: [&[int]; 2] = [&[1], &[2, 3]]; assert_eq!(v.connect_vec(&0), vec![1, 0, 2, 3]); - let v: [&[int], ..3] = [&[1], &[2], &[3]]; + let v: [&[int]; 3] = [&[1], &[2], &[3]]; assert_eq!(v.connect_vec(&0), vec![1, 0, 2, 0, 3]); } @@ -2710,7 +2711,7 @@ mod tests { } assert_eq!(cnt, 11); - let xs: [Foo, ..3] = [Foo, Foo, Foo]; + let xs: [Foo; 3] = [Foo, Foo, Foo]; cnt = 0; for f in xs.iter() { assert!(*f == Foo); diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index e5aa377b275..7caeb563db7 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -2517,7 +2517,7 @@ mod tests { #[test] fn test_chars_decoding() { - let mut bytes = [0u8, ..4]; + let mut bytes = [0u8; 4]; for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) { let len = c.encode_utf8(&mut bytes).unwrap_or(0); let s = ::core::str::from_utf8(bytes[..len]).unwrap(); @@ -2529,7 +2529,7 @@ mod tests { #[test] fn test_chars_rev_decoding() { - let mut bytes = [0u8, ..4]; + let mut bytes = [0u8; 4]; for c in range(0u32, 0x110000).filter_map(|c| ::core::char::from_u32(c)) { let len = c.encode_utf8(&mut bytes).unwrap_or(0); let s = ::core::str::from_utf8(bytes[..len]).unwrap(); diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index f703ff99660..37a6e690f5d 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -675,7 +675,7 @@ impl String { assert!(idx <= len); assert!(self.is_char_boundary(idx)); self.vec.reserve(4); - let mut bits = [0, ..4]; + let mut bits = [0; 4]; let amt = ch.encode_utf8(&mut bits).unwrap(); unsafe { -- cgit 1.4.1-3-g733a5