For clarity it is called try_for_each: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.htm...
The ? operator can be used both inside and after it like so:
iter.try_for_each(|_| { … xxx?; … })?;The ? operator can be used both inside and after it like so:
iter.try_for_each(|_| { … xxx?; … })?;https://blog.rust-lang.org/inside-rust/2022/07/27/keyword-ge...
If your for loop body is infallible then for_each is good enough.
If you're trying to 'collect' some iterator into some data structure T, you can collect into Result<T, _> and question mark on that.