diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-08 01:20:47 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-08 01:20:47 +1000 |
| commit | f661a15b2bd5c2a9ea984c72c28caf970317d8a3 (patch) | |
| tree | e7d02bba11ee7cb1016d1f4b047ab723d3ac443a /src/libstd | |
| parent | 5e9f006c5b95ea98893b0398decd458fd642f38f (diff) | |
| download | rust-f661a15b2bd5c2a9ea984c72c28caf970317d8a3.tar.gz rust-f661a15b2bd5c2a9ea984c72c28caf970317d8a3.zip | |
std: remove vec::each2 and vec::each2_mut in favour of iterators
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/vec.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 8340b956b65..54efd35b91e 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -1667,44 +1667,6 @@ pub fn eachi_reverse<'r,T>(v: &'r [T], } /** - * Iterates over two vectors simultaneously - * - * # Failure - * - * Both vectors must have the same length - */ -#[inline] -pub fn each2<U, T>(v1: &[U], v2: &[T], f: &fn(u: &U, t: &T) -> bool) -> bool { - assert_eq!(v1.len(), v2.len()); - for uint::range(0u, v1.len()) |i| { - if !f(&v1[i], &v2[i]) { - return false; - } - } - return true; -} - -/** - * - * Iterates over two vector with mutable. - * - * # Failure - * - * Both vectors must have the same length - */ -#[inline] -pub fn each2_mut<U, T>(v1: &mut [U], v2: &mut [T], - f: &fn(u: &mut U, t: &mut T) -> bool) -> bool { - assert_eq!(v1.len(), v2.len()); - for uint::range(0u, v1.len()) |i| { - if !f(&mut v1[i], &mut v2[i]) { - return false; - } - } - return true; -} - -/** * Iterate over all permutations of vector `v`. * * Permutations are produced in lexicographic order with respect to the order |
