swap method

Result<T> swap()

Implementation

@pragma('vm:prefer-inline')
Result<T> swap() {
  if (this is Ok<Err<T>>) {
    return (this as Ok<Err<T>>).unwrap();
  }
  return (this as Err<Err<T>>).transfErr();
}