Optimizing away bounds checks when zipping two iters of the same length

Note that you're making the compiler's life more difficult here by writing this over Vecs, as well as making your function less general. Write it taking slices instead (since you don't use the ownership in here) and it becomes much more obvious that there's only the panic from the assert, no other checks: https://rust.godbolt.org/z/9bMc7oTxE.

My usual advice:

3 Likes