Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc alias for iterator fold #77194

Merged
merged 2 commits into from
Sep 28, 2020
Merged

Add doc alias for iterator fold #77194

merged 2 commits into from
Sep 28, 2020

Conversation

pickfire
Copy link
Contributor

@pickfire pickfire commented Sep 25, 2020

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
Collaborator

r? @withoutboats

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 25, 2020
@jyn514 jyn514 added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 25, 2020
@cuviper
Copy link
Member

cuviper commented Sep 28, 2020

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
Contributor Author

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?

@withoutboats withoutboats changed the title Add alias for iterator fold Add doc alias for iterator fold Sep 28, 2020
@withoutboats
Copy link
Contributor

withoutboats commented Sep 28, 2020

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 28, 2020

📌 Commit ea0065a has been approved by withoutboats

@bors bors 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`.
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`.
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:master Sep 28, 2020
@rustbot rustbot 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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants