std: Flesh out result::extensions.
This commit is contained in:
parent
2ad20df40b
commit
72444636d3
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user