or method

Option<T> or(
  1. Option<T> other
)

Returns the option if it contains a value, otherwise returns other.

Implementation

@pragma("vm:prefer-inline")
Option<T> or(Option<T> other) {
  if (v == null) {
    return other;
  } else {
    return Some(v!);
  }
}