Skip to content

Instantly share code, notes, and snippets.

@c650
Created August 10, 2020 16:22
Show Gist options
  • Save c650/60ce417c7f11f1064b4fe9047cc37c57 to your computer and use it in GitHub Desktop.
Save c650/60ce417c7f11f1064b4fe9047cc37c57 to your computer and use it in GitHub Desktop.
fn main() {
let v = vec![1,2,3,4];
let b = v.iter().map(|e| e * 2).filter(|e| e % 6 == 0).fold(0, |acc, x| acc + x);
println!("{:?}", b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment