about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-09-11 12:52:17 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-09-12 18:54:13 -0700
commit38f97ea10313ba9a8c6f57fbf73ff8daf5376e8b (patch)
tree72966f38845b07f6f43291d06957634135d97030 /src/libsyntax/ext
parente03d60e9ebf2dbc2d18ab9919f905c17b967fcde (diff)
downloadrust-38f97ea10313ba9a8c6f57fbf73ff8daf5376e8b.tar.gz
rust-38f97ea10313ba9a8c6f57fbf73ff8daf5376e8b.zip
std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/expand.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 2cebae550fd..4d62285cf6e 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -331,11 +331,18 @@ pub fn expand_item_mac(extsbox: @mut SyntaxEnv,
     };
 
     let maybe_it = match expanded {
-        MRItem(it) => mark_item(it,fm).chain(|i| {fld.fold_item(i)}),
-        MRExpr(_) => cx.span_fatal(pth.span,
-                                   fmt!("expr macro in item position: %s", extnamestr)),
-        MRAny(_, item_maker, _) => item_maker().chain(|i| {mark_item(i,fm)})
-                                      .chain(|i| {fld.fold_item(i)}),
+        MRItem(it) => {
+            mark_item(it,fm)
+                .and_then(|i| fld.fold_item(i))
+        }
+        MRExpr(_) => {
+            cx.span_fatal(pth.span, fmt!("expr macro in item position: %s", extnamestr))
+        }
+        MRAny(_, item_maker, _) => {
+            item_maker()
+                .and_then(|i| mark_item(i,fm))
+                .and_then(|i| fld.fold_item(i))
+        }
         MRDef(ref mdef) => {
             // yikes... no idea how to apply the mark to this. I'm afraid
             // we're going to have to wait-and-see on this one.