diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-11-20 16:23:04 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-11-26 08:24:18 -0800 |
| commit | efc512362b0f2ae200ef079e3566c6b158a857cc (patch) | |
| tree | f13bd8c52a12ebff5bc304312aa9708bf34780dc /src/libsyntax/fold.rs | |
| parent | a61a3678ebe5571842d4223e2a0313714893bbf7 (diff) | |
| download | rust-efc512362b0f2ae200ef079e3566c6b158a857cc.tar.gz rust-efc512362b0f2ae200ef079e3566c6b158a857cc.zip | |
libsyntax: Remove all non-`proc` `do` syntax.
Diffstat (limited to 'src/libsyntax/fold.rs')
| -rw-r--r-- | src/libsyntax/fold.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index e81973835fe..b268988c3c5 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -187,12 +187,12 @@ pub trait ast_fold { } PatStruct(ref pth, ref fields, etc) => { let pth_ = self.fold_path(pth); - let fs = do fields.map |f| { + let fs = fields.map(|f| { ast::FieldPat { ident: f.ident, pat: self.fold_pat(f.pat) } - }; + }); PatStruct(pth_, fs, etc) } PatTup(ref elts) => PatTup(elts.map(|x| self.fold_pat(*x))), @@ -455,7 +455,7 @@ fn fold_arg_<T:ast_fold>(a: &arg, fld: &T) -> arg { // build a new vector of tts by appling the ast_fold's fold_ident to // all of the identifiers in the token trees. pub fn fold_tts<T:ast_fold>(tts: &[token_tree], fld: &T) -> ~[token_tree] { - do tts.map |tt| { + tts.map(|tt| { match *tt { tt_tok(span, ref tok) => tt_tok(span,maybe_fold_ident(tok,fld)), @@ -468,7 +468,7 @@ pub fn fold_tts<T:ast_fold>(tts: &[token_tree], fld: &T) -> ~[token_tree] { tt_nonterminal(sp,ref ident) => tt_nonterminal(sp,fld.fold_ident(*ident)) } - } + }) } // apply ident folder if it's an ident, otherwise leave it alone @@ -601,11 +601,11 @@ fn fold_field<T:ast_fold>(f: TypeField, folder: &T) -> TypeField { fn fold_opt_bounds<T:ast_fold>(b: &Option<OptVec<TyParamBound>>, folder: &T) -> Option<OptVec<TyParamBound>> { - do b.as_ref().map |bounds| { - do bounds.map |bound| { + b.as_ref().map(|bounds| { + bounds.map(|bound| { fold_ty_param_bound(bound, folder) - } - } + }) + }) } fn fold_variant_arg_<T:ast_fold>(va: &variant_arg, folder: &T) @@ -660,9 +660,9 @@ pub fn noop_fold_item_underscore<T:ast_fold>(i: &item_, folder: &T) -> item_ { item_enum(ref enum_definition, ref generics) => { item_enum( ast::enum_def { - variants: do enum_definition.variants.map |x| { + variants: enum_definition.variants.map(|x| { folder.fold_variant(x) - }, + }), }, fold_generics(generics, folder)) } @@ -678,12 +678,12 @@ pub fn noop_fold_item_underscore<T:ast_fold>(i: &item_, folder: &T) -> item_ { ) } item_trait(ref generics, ref traits, ref methods) => { - let methods = do methods.map |method| { + let methods = methods.map(|method| { match *method { required(ref m) => required(folder.fold_type_method(m)), provided(method) => provided(folder.fold_method(method)) } - }; + }); item_trait(fold_generics(generics, folder), traits.map(|p| fold_trait_ref(p, folder)), methods) |
