diff options
| author | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-09-11 12:52:17 -0700 |
|---|---|---|
| committer | Erick Tryzelaar <erick.tryzelaar@gmail.com> | 2013-09-12 18:54:13 -0700 |
| commit | 38f97ea10313ba9a8c6f57fbf73ff8daf5376e8b (patch) | |
| tree | 72966f38845b07f6f43291d06957634135d97030 /src/libsyntax/ext | |
| parent | e03d60e9ebf2dbc2d18ab9919f905c17b967fcde (diff) | |
| download | rust-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.rs | 17 |
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. |
