pub trait EvenArrayAdjacentPairs: ArrayAdjacentPairs {
// Required method
fn pair_adjacent(self) -> Self::AdjacentPairs;
}Expand description
An even-sized array.
Required Methods§
Sourcefn pair_adjacent(self) -> Self::AdjacentPairs
fn pair_adjacent(self) -> Self::AdjacentPairs
Turn an array into an array of pairs where each element is paired with an adjacent element.
§Example
use vectoreyes::array_utils::*;
assert_eq!(
[0, 1, 2, 3].pair_adjacent(),
[(0, 1), (2, 3)]
);