Rust’s design helps a bunch here in that internal iteration can already choose to use nested loops if that’s better for the structure in question. For example, https://doc.rust-lang.org/1.25.0/src/alloc/vec_deque.rs.html#1958-1964
I think I’d always rather refactor a for loop to .for_each() over refactoring to nested-for-using-batched. (Or try_for_each, in 1.27, if I need early-exit.)
Also, I think Rust’s HashMap doesn’t use buckets, so doesn’t actually need batched/segmented iteration…