Skip to content

Add doc alias for iterator fold - #77194

Merged
bors merged 2 commits into
rust-lang:masterfrom
pickfire:patch-7
Sep 28, 2020
Merged

Add doc alias for iterator fold#77194
bors merged 2 commits into
rust-lang:masterfrom
pickfire:patch-7

Conversation

@pickfire

@pickfirepickfire commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

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.

fold is known in python and javascript as reduce,
not sure about inject but it was written in doc there.
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @withoutboats

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 25, 2020
Comment threadlibrary/core/src/iter/traits/iterator.rs
@jyn514jyn514 added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs-api [DEPRECATED; DO NOT USE] labels Sep 25, 2020
@cuviper

Copy link
Copy Markdown
Member

FWIW, rayon has separate methods for fold and reduce, documented here:
https://docs.rs/rayon/1.4.0/rayon/iter/trait.ParallelIterator.html#fold-versus-reduce

That's not to dispute your alias -- they are related concepts, and it works fine as one method in a serial Iterator.

not sure about inject but it was written in doc there.

I don't know where that comes from either...

@pickfire

Copy link
Copy Markdown
ContributorAuthor

not sure about inject but it was written in doc there.

I don't know where that comes from either...

Maybe we should remove it?

@withoutboatswithoutboats changed the title Add alias for iterator foldAdd doc alias for iterator foldSep 28, 2020
@withoutboats

withoutboats commented Sep 28, 2020

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Sep 28, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit ea0065a has been approved by withoutboats

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2020
RalfJung added a commit to RalfJung/rust that referenced this pull request Sep 28, 2020
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`.
@RalfJungRalfJung mentioned this pull request Sep 28, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 28, 2020
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`.
@RalfJungRalfJung mentioned this pull request Sep 28, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2020
Rollup of 7 pull requests
Successful merges:
- rust-lang#76454 (UI to unit test for those using Cell/RefCell/UnsafeCell)
- rust-lang#76474 (Add option to pass a custom codegen backend from a driver)
- rust-lang#76711 (diag: improve closure/generic parameter mismatch)
- rust-lang#77170 (Remove `#[rustc_allow_const_fn_ptr]` and add `#![feature(const_fn_fn_ptr_basics)]`)
- rust-lang#77194 (Add doc alias for iterator fold)
- rust-lang#77288 (fix building libstd for Miri on macOS)
- rust-lang#77295 (Update unstable-book: Fix ABNF in inline assembly docs)
Failed merges:
r? `@ghost`
@bors
bors merged commit aba966a into rust-lang:masterSep 28, 2020
@rustbotrustbot added this to the 1.48.0 milestone Sep 28, 2020
@pickfire
pickfire deleted the patch-7 branch September 29, 2020 01:18
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libs-api[DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@pickfire@rust-highfive@cuviper@withoutboats@bors@jyn514@rustbot