mapNone method

  1. @override
  2. @visibleForTesting
None<T> mapNone(
  1. @noFutures None<T> noFutures(
    1. None<T> none
    )
)
override

Transforms the inner None instance if this is a None.

All None<T> instances are structurally identical (no value), so a caller-supplied transformer has nothing meaningful to change. Provided for pair-axis symmetry with mapSome and Result.mapErr — real code almost always wants fold or ifNone instead.

Implementation

@override
@visibleForTesting
@pragma('vm:prefer-inline')
None<T> mapNone(@noFutures None<T> Function(None<T> none) noFutures) {
  return noFutures(this);
}