mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
Rollup merge of #77194 - pickfire:patch-7, r=withoutboats
Add doc 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 was my first confusion when coming into rust, I somehow cannot find where is reduce, sometimes I still forget that it is known as `fold`.
This commit is contained in:
commit
aba966a592
@ -1976,6 +1976,8 @@ pub trait Iterator {
|
||||
/// // they're the same
|
||||
/// assert_eq!(result, result2);
|
||||
/// ```
|
||||
#[doc(alias = "reduce")]
|
||||
#[doc(alias = "inject")]
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
fn fold<B, F>(mut self, init: B, mut f: F) -> B
|
||||
|
Loading…
Reference in New Issue
Block a user