https://github.com/rust-lang/rust/issues/94047 kinda like the try_collect feature but for iterators
#try_collect without the collect
5 messages · Page 1 of 1 (latest)
also does the compiler understand this way of doing stuff?
try_collect without the collect
fn try_flatten<Output, Residual>(
mut iter: impl Iterator<Item = Result<Output, Residual>>,
) -> Result<impl IntoIterator<Item = Output>, Residual> {
iter.try_fold(vec![], |mut acc, item| {
acc.push(item?);
Ok(acc)
})
}
is try_collect that lies