Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created August 6, 2013 16:45
Embed
What would you like to do?
I love the new Rust iterators.
fn main() {
let arr = [1,2,3];
let result = arr.iter().fold(0, |acc, i| acc + *i);
println(result.to_str());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment