Macro wikimedia::try_iter

source ·
macro_rules! try_iter {
    ($expr:expr $(,)?) => { ... };
}
Expand description

Analagous to the std::try!(Result<T,E>) macro but for use in a function that returns Option<Result<T,E>>, such as Iterator::next() methods (hence the name).

Unwraps a val: Result<T,E> to a T value or if val is Err(e) returns that early.

For use in a function that returns Result<Option<T2>,E2>.