zip<U> method

  1. @override
  2. @useResult
None<(T, U)> zip<U>(
  1. Option<U> other
)
override

Returns a tuple of both this and other if both are Some, or None otherwise.

Examples

// prints "Some((2, some))"
print(const Some(2).zip(const Some('some')));

// prints "None"
print(const Some(2).zip(const None<String>()));

Implementation

@override
@useResult
// ignore: non_const_call_to_literal_constructor
None<(T, U)> zip<U>(Option<U> other) => None<(T, U)>();