ifSome method

  1. @override
Result<Some<T>> ifSome(
  1. @noFutures void noFutures(
    1. Some<T> self,
    2. Some<T> none
    )
)
override

Performs a side-effect with the contained value if this is a Some.

Implementation

@override
@pragma('vm:prefer-inline')
Result<Some<T>> ifSome(
  @noFutures void Function(Some<T> self, Some<T> none) noFutures,
) {
  return Sync(() {
    noFutures(this, this);
    return this;
  }).value;
}