peroxide::util::useful

Function auto_zip

Source
pub fn auto_zip<T: Clone>(x: &Vec<T>) -> Vec<(T, T)>
Expand description

Auto-zip

ยงExamples

extern crate peroxide;
use peroxide::fuga::*;

let a = vec![1, 2, 3];
let a_zipped = auto_zip(&a);
assert_eq!(a_zipped, vec![(1, 2), (2, 3)]);