diff options
| author | Ivan Tham <pickfire@riseup.net> | 2020-09-26 00:04:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-26 00:04:34 +0800 |
| commit | 1994cee61a4aea9dc46bb3d0323c8290621eda33 (patch) | |
| tree | c9d2cbb50da45801bcaa5c6fc0d6651e5a021aad | |
| parent | b984ef6797ff17faa2b1e0ebb54b78de1491e5fd (diff) | |
| download | rust-1994cee61a4aea9dc46bb3d0323c8290621eda33.tar.gz rust-1994cee61a4aea9dc46bb3d0323c8290621eda33.zip | |
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.
| -rw-r--r-- | library/core/src/iter/traits/iterator.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index f70e92f0ffa..ec257a11465 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -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 |
