코딩Coding/Rust연습
rust 연습] iter(), zip() 연습
내인생PLUS
2022. 4. 11. 17:12
728x90
fn main() {
let a1 = [1 ,2, 3];
let a2 = [4 ,5, 6];
let mut iter = a1.iter().zip(a2.iter());
println!("{:?}", iter.next());
println!("{:?}", iter.next());
}
결과
https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.zip
반응형