Loading RustViz Engine...
Pair up items from two disparate iterators until the shorter one terminates.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
pub struct MyZip<A, B> {
a: A,
b: B,
}
impl<A: Iterator, B: Iterator> Iterator for MyZip<A, B> {
type Item = (A::Item, B::Item);
fn next(&mut self) -> Option<Self::Item> {
let x = self.a.next()?;
let y = self.b.next()?;
Some((x, y))
}
}