Since Rust 1.11, you can sum the iterator directly, skipping fold : let sum: u32 = vec![1, 2, 3, 4, 5, 6].iter().sum(); ...
確定! 回上一頁