tryForEach method
Result<(), E>
tryForEach(
- void f(
- T
An iterator method that applies a function, stopping at the first Err and returning that Err.
Implementation
Result<(), E> tryForEach(void Function(T) f) {
for (final res in this) {
if (res.isErr()) {
return res.intoUnchecked();
}
f(res.unwrap());
}
return const Ok(());
}