diff options
| author | blake2-ppc <blake2-ppc> | 2013-08-03 21:34:00 +0200 |
|---|---|---|
| committer | blake2-ppc <blake2-ppc> | 2013-08-06 04:05:07 +0200 |
| commit | 520f292e48a61538e681ce61d46a58f965c800a1 (patch) | |
| tree | e804eff9a1b0ff82d22cee2037ecf61fb95bc021 /src/libstd/result.rs | |
| parent | 78effe762666f64de28c890ea1a15672c712f390 (diff) | |
| download | rust-520f292e48a61538e681ce61d46a58f965c800a1.tar.gz rust-520f292e48a61538e681ce61d46a58f965c800a1.zip | |
std: Use method name Option::consume
With Option as the simplest container, `consume` is the way to turn it into a by-value iterator.
Diffstat (limited to 'src/libstd/result.rs')
| -rw-r--r-- | src/libstd/result.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/result.rs b/src/libstd/result.rs index 5a6021d32a5..91f42edf0ae 100644 --- a/src/libstd/result.rs +++ b/src/libstd/result.rs @@ -94,7 +94,7 @@ impl<T, E: ToStr> Result<T, E> { match *self { Ok(ref t) => Some(t), Err(*) => None, - }.consume_iter() + }.consume() } /// Call a method based on a previous result @@ -108,7 +108,7 @@ impl<T, E: ToStr> Result<T, E> { match *self { Ok(*) => None, Err(ref t) => Some(t), - }.consume_iter() + }.consume() } /// Unwraps a result, yielding the content of an `Ok`. |
