zip and unzip can only work with pairs (converting between 2-element tuples and 2 iterators). Let's expand it to arbitrary number rather than 2 (conversion between N-sized tuples and N iterators).
Example use case:
// Let's say I'm writing a unit test for a function that returns this vec:
fn tupler() -> Vec<(u64, &str, u64, u64, bool)>{
vec![
(1, "2", 3, 4, false),
(1, "lol", 5, 10, true),
...,
(100, "hello", 82, 47, true)
]
}
#[cfg(test)]
mod tests {
#[test]
fn tuple_test() {
let tuples_vec = super::tupler();
// And let's also say I have real/correct data to compare the
// function output against, and this real/correct data comes
// in the form of 5 separate vectors:
let vec1 = vec![1, 1, ..., 100];
let vec2 = vec!["2", "lol", ..., "hello"];
let vec3 = vec![3, 5, ..., 82];
let vec4 = vec![4, 10, ..., 47];
let vec5 = vec![false, true, ..., true];
// would be awesome if I could somehow unzip the vectors of
// 5-sized tuples into 5 separate iterators and create an
// assertion for each iterator:
let (func_val1, func_val2, func_val3, func_val4, func_val5) =
tuples_vec.iter().unzip();
assert_eq!(func_val1, vec1);
assert_eq!(func_val2, vec2);
assert_eq!(func_val3, vec3);
assert_eq!(func_val4, vec4);
assert_eq!(func_val5, vec5);
}
}