std: Flesh out result::extensions.

This commit is contained in:
Erick Tryzelaar 2012-04-01 15:44:01 -07:00
parent 2ad20df40b
commit 72444636d3

View File

@ -109,6 +109,14 @@ fn chain_err<T: copy, U: copy, V: copy>(
}
impl extensions<T:copy, E:copy> for result<T,E> {
fn get() -> T { get(self) }
fn get_err() -> E { get_err(self) }
fn success() -> bool { success(self) }
fn failure() -> bool { failure(self) }
fn chain<U:copy>(op: fn(T) -> result<U,E>) -> result<U,E> {
chain(self, op)
}