Vec from an Iterator
Published 331d ago
Rob
Generate a Vec of even numbers from an iterator
fn main() {
let v: Vec<i32> = (0..10).filter(|i| i % 2 == 0).collect();
println!("{:?}\n", v);
}
Please login or sign up to comment and collaborate
Published 331d ago
Generate a Vec of even numbers from an iterator
fn main() {
let v: Vec<i32> = (0..10).filter(|i| i % 2 == 0).collect();
println!("{:?}\n", v);
}
Please login or sign up to comment and collaborate