where method
Filters this Option based on the given predicate function.
Returns None if this Option is None, otherwise calls predicate with
the held value, returning:
See also:
Rust: Option::filter()
Implementation
Option<T> where(bool Function(T) predicate) => switch (this) {
Some(value: T value) => predicate(value) ? this : None(),
None() => this
};