std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}

This commit is contained in:
Erick Tryzelaar 2013-09-11 12:52:17 -07:00
parent e03d60e9eb
commit 38f97ea103
25 changed files with 205 additions and 164 deletions

View file

@ -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.