or abstract method

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

Returns a Some of the original value if this is a Some, or other otherwise.

Examples

// prints "Some(2)"
print(const Some(2).or(const Some(3)));

// prints "Some(3)"
print(const None<int>().or(const Some(3)));

Implementation

@useResult
Option<T> or(Option<T> other);