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
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue