pairwise_iter_copy

Function pairwise_iter_copy 

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

Iterates through every pair in the input slice. Returns copies of the input.

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