pairwise_iter_i

Function pairwise_iter_i 

Source
pub fn pairwise_iter_i<T>(v: &[T]) -> impl Iterator<Item = (usize, usize)>
Expand description

Iterates through every pair in the input slice. Returns indices into the input.

let input = [1, 2, 3];
let want = [(0, 1), (0, 2), (1, 2)];
assert_eq!(aoclib_rs::iter::pairwise_iter_i(&input).collect::<Vec<_>>(), want);