Add description of fold function arguments.

This commit is contained in:
Łukasz Niemier 2015-03-02 22:31:01 +01:00 committed by Steve Klabnik
parent 6dcc0e5631
commit 3ad1c83540

View File

@ -611,7 +611,7 @@ pub trait IteratorExt: Iterator + Sized {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert!(a.iter().fold(0, |a, &b| a + b) == 15);
/// assert!(a.iter().fold(0, |acc, &item| acc + item) == 15);
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]