toOption method

Option<T> toOption()

Convert to Option, where Ok becomes Some and Err becomes None.

Implementation

Option<T> toOption() => isOk ? Some((this as Ok<T, E>).value) : const None();