Trait vectoreyes::array_utils::EvenArrayAdjacentPairs
source · [−]pub trait EvenArrayAdjacentPairs: ArrayAdjacentPairs {
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)]
);