summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-06-08 01:20:47 +1000
committerHuon Wilson <dbau.pp+github@gmail.com>2013-06-08 01:20:47 +1000
commitf661a15b2bd5c2a9ea984c72c28caf970317d8a3 (patch)
treee7d02bba11ee7cb1016d1f4b047ab723d3ac443a /src/libsyntax
parent5e9f006c5b95ea98893b0398decd458fd642f38f (diff)
downloadrust-f661a15b2bd5c2a9ea984c72c28caf970317d8a3.tar.gz
rust-f661a15b2bd5c2a9ea984c72c28caf970317d8a3.zip
std: remove vec::each2 and vec::each2_mut in favour of iterators
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/deriving/generic.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index 52a2d9ff9de..b36d4496492 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -174,6 +174,7 @@ use opt_vec;
 
 use core::uint;
 use core::vec;
+use core::iterator::IteratorUtil;
 
 pub use self::ty::*;
 mod ty;
@@ -616,7 +617,7 @@ impl<'self> MethodDef<'self> {
         // make a series of nested matches, to destructure the
         // structs. This is actually right-to-left, but it shoudn't
         // matter.
-        for vec::each2(self_args, patterns) |&arg_expr, &pat| {
+        for self_args.iter().zip(patterns.iter()).advance |(&arg_expr, &pat)| {
             body = cx.expr_match(span, arg_expr,
                                  ~[ cx.arm(span, ~[pat], body) ])
         }
@@ -951,7 +952,7 @@ fn create_struct_pattern(cx: @ExtCtxt,
     // must be nonempty to reach here
     let pattern = if struct_type == Record {
         let field_pats = do vec::build |push| {
-            for vec::each2(subpats, ident_expr) |&pat, &(id, _)| {
+            for subpats.iter().zip(ident_expr.iter()).advance |(&pat, &(id, _))| {
                 // id is guaranteed to be Some
                 push(ast::field_pat { ident: id.get(), pat: pat })
             }