unzip method

(Option<T>, Option<U>) unzip()

Unzips an option containing a tuple of two options. If self is Some((a, b)) this method returns (Some(a), Some(b)). Otherwise, (None, None) is returned.

Implementation

(Option<T>, Option<U>) unzip() {
  if (isSome()) {
    final (one, two) = unwrap();
    return (Some(one), Some(two));
  }
  return (None, None);
}