andThen<U> method
Returns None<U> if this Option
is None<T>, otherwise calls fn
with
the held value and returns the returned Option
.
See also:
Rust: Option::and_then()
Implementation
Option<U> andThen<U>(Option<U> Function(T) fn) {
return switch (this) {
Some(:T v) => fn(v),
None() => None(),
};
}