#013 Mar 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); show more