diff options
| author | bors <bors@rust-lang.org> | 2013-05-15 07:38:07 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-15 07:38:07 -0700 |
| commit | 4e8261009948ed1cfbbdaf4ecc3fadef795b27b7 (patch) | |
| tree | 4eb235105de5e0b361a7a661ca347530f51e8283 /src/test | |
| parent | 803c12d85fa898950d9efa9078b64519a1b78ab6 (diff) | |
| parent | a2a8596c3dd963e7b51f11998cffc46033bf6d63 (diff) | |
| download | rust-4e8261009948ed1cfbbdaf4ecc3fadef795b27b7.tar.gz rust-4e8261009948ed1cfbbdaf4ecc3fadef795b27b7.zip | |
auto merge of #6487 : recrack/rust/vec_len, r=thestinger
Rename vec::len(var) to var.len() ``` libcore, libfuzzer, librustc, librustdoc, libstd, libsyntax test/auxiliary test/bench test/run-pass ```
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/auxiliary/cci_iter_lib.rs | 2 | ||||
| -rw-r--r-- | src/test/auxiliary/cci_no_inline_lib.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/graph500-bfs.rs | 4 | ||||
| -rw-r--r-- | src/test/bench/shootout-k-nucleotide-pipes.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/sudoku.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/assignability-trait.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/class-implements-multiple-traits.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/hashmap-memory.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/vec-self-append.rs | 8 |
9 files changed, 17 insertions, 17 deletions
diff --git a/src/test/auxiliary/cci_iter_lib.rs b/src/test/auxiliary/cci_iter_lib.rs index e44267373ef..a264c7d238f 100644 --- a/src/test/auxiliary/cci_iter_lib.rs +++ b/src/test/auxiliary/cci_iter_lib.rs @@ -13,7 +13,7 @@ #[inline] pub fn iter<T>(v: &[T], f: &fn(&T)) { let mut i = 0u; - let n = vec::len(v); + let n = v.len(); while i < n { f(&v[i]); i += 1u; diff --git a/src/test/auxiliary/cci_no_inline_lib.rs b/src/test/auxiliary/cci_no_inline_lib.rs index f79227d87cd..fbdb7806b5e 100644 --- a/src/test/auxiliary/cci_no_inline_lib.rs +++ b/src/test/auxiliary/cci_no_inline_lib.rs @@ -13,7 +13,7 @@ // same as cci_iter_lib, more-or-less, but not marked inline pub fn iter(v: ~[uint], f: &fn(uint)) { let mut i = 0u; - let n = vec::len(v); + let n = v.len(); while i < n { f(v[i]); i += 1u; diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index 6fd31aa7b9f..ddf6f4bfc55 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -126,7 +126,7 @@ fn gen_search_keys(graph: &[~[node_id]], n: uint) -> ~[node_id] { */ fn bfs(graph: graph, key: node_id) -> bfs_result { let mut marks : ~[node_id] - = vec::from_elem(vec::len(graph), -1i64); + = vec::from_elem(graph.len(), -1i64); let mut q = Deque::new(); @@ -429,7 +429,7 @@ fn main() { let stop = time::precise_time_s(); io::stdout().write_line(fmt!("Generated %? edges in %? seconds.", - vec::len(edges), stop - start)); + edges.len(), stop - start)); let start = time::precise_time_s(); let graph = make_graph(1 << scale, copy edges); diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index fa6b7066e40..3c32ec338b7 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -95,7 +95,7 @@ fn windows_with_carry(bb: &[u8], nn: uint, it: &fn(window: &[u8])) -> ~[u8] { let mut ii = 0u; - let len = vec::len(bb); + let len = bb.len(); while ii < len - (nn - 1u) { it(vec::slice(bb, ii, ii+nn)); ii += 1u; diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs index c383cdf4318..c18c1eaedd6 100644 --- a/src/test/bench/sudoku.rs +++ b/src/test/bench/sudoku.rs @@ -70,7 +70,7 @@ pub impl Sudoku { let line = reader.read_line(); let mut comps = ~[]; for str::each_split_char(line.trim(), ',') |s| { comps.push(s.to_owned()) } - if vec::len(comps) == 3u { + if comps.len() == 3u { let row = uint::from_str(comps[0]).get() as u8; let col = uint::from_str(comps[1]).get() as u8; g[row][col] = uint::from_str(comps[2]).get() as u8; @@ -103,7 +103,7 @@ pub impl Sudoku { } let mut ptr = 0u; - let end = vec::len(work); + let end = work.len(); while (ptr < end) { let (row, col) = work[ptr]; // is there another color to try? @@ -265,7 +265,7 @@ fn check_default_sudoku_solution() { fn main() { let args = os::args(); - let use_default = vec::len(args) == 1u; + let use_default = args.len() == 1u; let mut sudoku = if use_default { Sudoku::from_vec(&default_sudoku) } else { diff --git a/src/test/run-pass/assignability-trait.rs b/src/test/run-pass/assignability-trait.rs index 6946ed3fbcf..b21213bb221 100644 --- a/src/test/run-pass/assignability-trait.rs +++ b/src/test/run-pass/assignability-trait.rs @@ -39,15 +39,15 @@ pub fn main() { // Call a method for x.iterate() |y| { assert!(x[*y] == *y); } // Call a parameterized function - assert!(length(x.clone()) == vec::len(x)); + assert!(length(x.clone()) == x.len()); // Call a parameterized function, with type arguments that require // a borrow - assert!(length::<int, &[int]>(x) == vec::len(x)); + assert!(length::<int, &[int]>(x) == x.len()); // Now try it with a type that *needs* to be borrowed let z = [0,1,2,3]; // Call a method for z.iterate() |y| { assert!(z[*y] == *y); } // Call a parameterized function - assert!(length::<int, &[int]>(z) == vec::len(z)); + assert!(length::<int, &[int]>(z) == z.len()); } diff --git a/src/test/run-pass/class-implements-multiple-traits.rs b/src/test/run-pass/class-implements-multiple-traits.rs index 3a5bd648639..61dfcfed7bd 100644 --- a/src/test/run-pass/class-implements-multiple-traits.rs +++ b/src/test/run-pass/class-implements-multiple-traits.rs @@ -103,7 +103,7 @@ fn annoy_neighbors<T:noisy>(critter: T) { fn bite_everything<T:bitey>(critter: T) -> bool { let mut left : ~[body_part] = ~[finger, toe, nose, ear]; - while vec::len(left) > 0u { + while left.len() > 0u { let part = critter.bite(); debug!("%? %?", left, part); if vec_includes(left, part) { diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index bca4cbafc6c..c6ae2047147 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -71,7 +71,7 @@ mod map_reduce { start_mappers(ctrl_chan, inputs.clone()); - let mut num_mappers = vec::len(inputs) as int; + let mut num_mappers = inputs.len() as int; while num_mappers > 0 { match ctrl_port.recv() { diff --git a/src/test/run-pass/vec-self-append.rs b/src/test/run-pass/vec-self-append.rs index acd9cf6f01b..7507a78378e 100644 --- a/src/test/run-pass/vec-self-append.rs +++ b/src/test/run-pass/vec-self-append.rs @@ -14,7 +14,7 @@ fn test_heap_to_heap() { // a spills onto the heap let mut a = ~[0, 1, 2, 3, 4]; a = a + a; // FIXME(#3387)---can't write a += a - assert!((vec::len(a) == 10u)); + assert!(a.len() == 10u); assert!((a[0] == 0)); assert!((a[1] == 1)); assert!((a[2] == 2)); @@ -32,7 +32,7 @@ fn test_stack_to_heap() { let mut a = ~[0, 1, 2]; // a spills to the heap a = a + a; // FIXME(#3387)---can't write a += a - assert!((vec::len(a) == 6u)); + assert!(a.len() == 6u); assert!((a[0] == 0)); assert!((a[1] == 1)); assert!((a[2] == 2)); @@ -47,8 +47,8 @@ fn test_loop() { let mut i = 20; let mut expected_len = 1u; while i > 0 { - error!(vec::len(a)); - assert!((vec::len(a) == expected_len)); + error!(a.len()); + assert!(a.len() == expected_len); a = a + a; // FIXME(#3387)---can't write a += a i -= 1; expected_len *= 2u; |
