zip<U> method
Zips this Option
with another Option
, returning a Record of their
held values.
Returns:
- Some<(T, U)> if this
Option
is Some<T> andother
is Some<U>. - None<(T, U)> otherwise.
See: OptionUnzip.unzip() for reversing this operation.
See also:
Rust: Option::zip()
Implementation
Option<(T, U)> zip<U>(Option<U> other) => switch ((this, other)) {
(Some(value: T a), Some(value: U b)) => Some((a, b)),
_ => None()
};