You can also write that with try_fold:
let c: Result<Vec<i32>, Error> = b.into_iter()
.try_fold(vec![], |mut unrolled, result| {
unrolled.extend(result?);
Ok(unrolled)
});
You can also write that with try_fold:
let c: Result<Vec<i32>, Error> = b.into_iter()
.try_fold(vec![], |mut unrolled, result| {
unrolled.extend(result?);
Ok(unrolled)
});