This Rust tutorial explains the fold() mechanism well, and this example code:let sum = (1..4).fold(0, |sum, x| sum + x); works as expected.
確定! 回上一頁