mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-29 19:47:38 +00:00
std: Rename result::methods to result::extensions
This commit is contained in:
parent
44c7386376
commit
2ad20df40b
@ -108,7 +108,7 @@ fn chain_err<T: copy, U: copy, V: copy>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl methods<T:copy,E:copy> for result<T,E> {
|
impl extensions<T:copy, E:copy> for result<T,E> {
|
||||||
fn chain<U:copy>(op: fn(T) -> result<U,E>) -> result<U,E> {
|
fn chain<U:copy>(op: fn(T) -> result<U,E>) -> result<U,E> {
|
||||||
chain(self, op)
|
chain(self, op)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import middle::ty;
|
|||||||
import syntax::ast;
|
import syntax::ast;
|
||||||
import syntax::ast::{ret_style};
|
import syntax::ast::{ret_style};
|
||||||
import util::ppaux::{ty_to_str, mt_to_str};
|
import util::ppaux::{ty_to_str, mt_to_str};
|
||||||
import result::{result, methods, chain, chain_err, ok, err, map, map2, iter2};
|
import result::{result, extensions, ok, err, map, map2, iter2};
|
||||||
import ty::type_is_bot;
|
import ty::type_is_bot;
|
||||||
|
|
||||||
export infer_ctxt;
|
export infer_ctxt;
|
||||||
@ -85,7 +85,7 @@ fn fixup_vars(cx: infer_ctxt, a: ty::t) -> fres<ty::t> {
|
|||||||
impl methods for ures {
|
impl methods for ures {
|
||||||
fn then<T:copy>(f: fn() -> result<T,ty::type_err>)
|
fn then<T:copy>(f: fn() -> result<T,ty::type_err>)
|
||||||
-> result<T,ty::type_err> {
|
-> result<T,ty::type_err> {
|
||||||
chain(self) {|_i| f() }
|
self.chain() {|_i| f() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user