There are lots of ways you could mean this.
If you just want to panic, use .map(|x| x.unwrap())
.
If you want all results or a single error, collect
into a Result>
:
let results: Result, _> = result_i32_iter.collect();
If you want everything except the errors, use .filter_map(|x| x.ok())
or .flat_map(|x| x)
.
If you want everything up to the first error, use .scan((), |_, x| x.ok())
.
let results: Vec = result_i32_iter.scan((), |_, x| x.ok());
Note that these operations can be combined with earlier operations in many cases.