Skip to content

Conversation

ranger-ross
Copy link
Contributor

This PR clarifies the closure requirements for core::iter::from_fn and core::iter::successors.

std::iter::successors in particular is a bit difficult to understand if you are not already familiar with the signature of checked_mul used in the example.

See #135087

@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2025

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 5, 2025
@ranger-ross ranger-ross force-pushed the better-docs-on-iter-fns branch from fc51ac6 to 76ae7ab Compare January 5, 2025 09:17
@ranger-ross ranger-ross force-pushed the better-docs-on-iter-fns branch from 76ae7ab to 6243c0f Compare January 5, 2025 10:25
@jhpratt
Copy link
Member

jhpratt commented Jan 5, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 5, 2025

📌 Commit 6243c0f has been approved by jhpratt

It is now in the queue for this repository.

@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 Jan 5, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 6, 2025
Rollup of 3 pull requests

Successful merges:

 - rust-lang#135115 (cg_llvm: Use constants for DWARF opcodes, instead of FFI calls)
 - rust-lang#135118 (Clarified the documentation on `core::iter::from_fn` and `core::iter::successors`)
 - rust-lang#135121 (Mark `slice::reverse` unstably const)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit af9293f into rust-lang:master Jan 6, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 6, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 6, 2025
Rollup merge of rust-lang#135118 - ranger-ross:better-docs-on-iter-fns, r=jhpratt

Clarified the documentation on `core::iter::from_fn` and `core::iter::successors`

This PR clarifies the closure requirements for `core::iter::from_fn` and `core::iter::successors`.

`std::iter::successors` in particular is a bit difficult to understand if you are not already familiar with the signature of [`checked_mul`](https://docs.rs/num/latest/num/trait.CheckedMul.html) used in the example.

See rust-lang#135087
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants