about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-06-08 18:28:08 +1000
committerHuon Wilson <dbau.pp+github@gmail.com>2013-06-09 02:22:23 +1000
commit513d2292e5a743e630ceece06255528c1902ac01 (patch)
tree2bfd6a023b397d60a5923a66cdcb47241ac1b043 /src/libsyntax/ext
parented299af62566a9f0f285e81408aab5f7680ab4cc (diff)
downloadrust-513d2292e5a743e630ceece06255528c1902ac01.tar.gz
rust-513d2292e5a743e630ceece06255528c1902ac01.zip
std: remove foldr and alli methods in vec
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/deriving/generic.rs8
-rw-r--r--src/libsyntax/ext/deriving/mod.rs3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs
index b36d4496492..078fd4231ca 100644
--- a/src/libsyntax/ext/deriving/generic.rs
+++ b/src/libsyntax/ext/deriving/generic.rs
@@ -1025,11 +1025,11 @@ pub fn cs_fold(use_foldl: bool,
     match *substructure.fields {
         EnumMatching(_, _, ref all_fields) | Struct(ref all_fields) => {
             if use_foldl {
-                do all_fields.foldl(base) |&old, &(_, self_f, other_fs)| {
+                do all_fields.iter().fold(base) |old, &(_, self_f, other_fs)| {
                     f(cx, span, old, self_f, other_fs)
                 }
             } else {
-                do all_fields.foldr(base) |&(_, self_f, other_fs), old| {
+                do all_fields.rev_iter().fold(base) |old, &(_, self_f, other_fs)| {
                     f(cx, span, old, self_f, other_fs)
                 }
             }
@@ -1094,11 +1094,11 @@ pub fn cs_same_method_fold(use_foldl: bool,
     cs_same_method(
         |cx, span, vals| {
             if use_foldl {
-                do vals.foldl(base) |&old, &new| {
+                do vals.iter().fold(base) |old, &new| {
                     f(cx, span, old, new)
                 }
             } else {
-                do vals.foldr(base) |&new, old| {
+                do vals.rev_iter().fold(base) |old, &new| {
                     f(cx, span, old, new)
                 }
             }
diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs
index 1107f21319c..c091ab8b617 100644
--- a/src/libsyntax/ext/deriving/mod.rs
+++ b/src/libsyntax/ext/deriving/mod.rs
@@ -19,6 +19,7 @@ library.
 */
 
 use core::prelude::*;
+use core::iterator::IteratorUtil;
 
 use ast::{enum_def, ident, item, Generics, meta_item, struct_def};
 use ext::base::ExtCtxt;
@@ -74,7 +75,7 @@ pub fn expand_meta_deriving(cx: @ExtCtxt,
             in_items
         }
         meta_list(_, ref titems) => {
-            do titems.foldr(in_items) |&titem, in_items| {
+            do titems.rev_iter().fold(in_items) |in_items, &titem| {
                 match titem.node {
                     meta_name_value(tname, _) |
                     meta_list(tname, _) |