1 个不稳定版本
0.1.0 | 2022 年 12 月 22 日 |
---|
#93 在 #zip
6KB
tuple_zip
一个将迭代器元组转换为元组迭代器的 crate
use tuple_zip::TupleZip;
let a = [1, 2, 3, 4];
let b = [5, 6, 7];
let c = ["x", "y", "z"];
let zipped = (a, b, c).tuple_zip();
let expected = [(1, 5, "x"), (2, 6, "y"), (3, 7, "z")];
assert!(zipped.eq(expected));
许可协议为 Apache-2.0 或 MIT,您选择
lib.rs
:
一个将迭代器元组转换为元组迭代器的 crate
use tuple_zip::TupleZip;
let a = [1, 2, 3, 4];
let b = [5, 6, 7];
let c = ["x", "y", "z"];
let zipped = (a, b, c).tuple_zip();
let expected = [(1, 5, "x"), (2, 6, "y"), (3, 7, "z")];
assert!(zipped.eq(expected));