flatten method
Flattens a nested Option
type value one level.
Returns:
- Some<T> if this
Option
is Some<Option<T>>. - None<T> if this
Option
is None<Option<T>>.
See also:
Rust: Option::flatten()
Implementation
Option<T> flatten() => switch (this) {
Some(value: Option<T> value) => value,
None() => None()
};