and<U> method

  1. @override
  2. @useResult
None<U> and<U>(
  1. Option<U> other
)
override

Returns other if this is a Some, or None otherwise.

Examples

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

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

Implementation

@override
@useResult
None<U> and<U>(Option<U> other) => None<U>();