and<U> method
Returns other
if this
is an Ok, or an Err of the original error otherwise.
Examples
// prints "Ok(3)"
print(const Ok<int, String>(2).and(const Ok(3)));
// prints "Err(error)"
print(const Err<int, String>('error').and(const Ok(3)));
Implementation
@override
@useResult
Result<U, E> and<U>(Result<U, E> other) => other;