Skip to content

Commit 0d347e1

Browse files
committed
Rollup merge of rust-lang#25144 - killercup:docs/iter-fold-reduce, r=steveklabnik
Enhance Google-ability of `.fold()` by mentioning 'reduce' and 'inject' in the docs. Motivation: [This thread on users.rust-lang.org](https://users.rust-lang.org/t/find-the-shortest-string-in-a-vector/1247)
2 parents 1d31839 + 1d6285e commit 0d347e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libcore/iter.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,8 @@ pub trait Iterator {
602602
/// Performs a fold operation over the entire iterator, returning the
603603
/// eventual state at the end of the iteration.
604604
///
605+
/// This operation is sometimes called 'reduce' or 'inject'.
606+
///
605607
/// # Examples
606608
///
607609
/// ```

0 commit comments

Comments
 (0)