toNullable method

T? toNullable()

Returns the value if it exists, otherwise null

Implementation

T? toNullable() => switch (this) {
      Some(:final value) => value,
      _ => null,
    };