std: remove fold[lr] in favour of iterators

This commit is contained in:
Huon Wilson
2013-06-08 15:12:39 +10:00
parent 65c7c58c8f
commit ed299af625
25 changed files with 72 additions and 193 deletions

View File

@@ -27,6 +27,7 @@ use parse::token::{ident_to_str, intern, fresh_name};
use visit;
use visit::{Visitor,mk_vt};
use core::iterator::IteratorUtil;
use core::vec;
pub fn expand_expr(extsbox: @mut SyntaxEnv,
@@ -128,7 +129,7 @@ pub fn expand_mod_items(extsbox: @mut SyntaxEnv,
// decorated with "item decorators", then use that function to transform
// the item into a new set of items.
let new_items = do vec::flat_map(module_.items) |item| {
do vec::foldr(item.attrs, ~[*item]) |attr, items| {
do item.attrs.rev_iter().fold(~[*item]) |items, attr| {
let mname = attr::get_attr_name(attr);
match (*extsbox).find(&intern(*mname)) {