Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let names = vec!["Jane", "Jill", "Jack", "John"];
- let len = names.iter().map(|name| {
- name.len()
- })
- .fold(0, |total:usize, curr: usize| {
- total + curr
- });
- println!("Total size {} ", len);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement