Add alias for iterator fold
fold is known in python and javascript as reduce, not sure about inject but it was written in doc there.
This commit is contained in:
parent
b984ef6797
commit
1994cee61a
@ -1977,6 +1977,8 @@ pub trait Iterator {
|
||||
/// assert_eq!(result, result2);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[doc(alias = "reduce")]
|
||||
#[doc(alias = "inject")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fold<B, F>(mut self, init: B, mut f: F) -> B
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user