#013 Mar 20, 2022iterator fold13. FoldIterator consumer. Allows the accumulated value to be arbitrary type. Note the different types.1 2 3 let nums: Vec<u8> = vec![1, 2, 3, 4]; let sum = nums.iter().fold(0u32, |acc, x| acc + *x as u32); assert_eq!(sum, 10); This post is licensed under CC BY 4.0 by the author.Share: ← Previous 17. filter_map Next → 12. Enumerate