Skip to content

Commit

Permalink
Add alias for iterator fold
Browse files Browse the repository at this point in the history
fold is known in python and javascript as reduce,
not sure about inject but it was written in doc there.
  • Loading branch information
pickfire committed Sep 25, 2020
1 parent b984ef6 commit 1994cee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1994cee

Please sign in to comment.