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

Document Iterator::sum/product for Option/Result #106434

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

clubby789
Copy link
Contributor

Closes #105266

We already document the similar behavior for collect() so I believe it makes sense to add this too. The Option/Result implementations are documented on their respective pages and the page for Sum, but buried amongst many other trait impls which doesn't make it very discoverable.

@rustbot label +A-docs

@rustbot
Copy link
Collaborator

rustbot commented Jan 4, 2023

r? @m-ou-se

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

@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 4, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 4, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Jan 4, 2023
@clubby789 clubby789 force-pushed the document-sum-result branch 2 times, most recently from 3b9bb8a to 7333609 Compare January 4, 2023 02:24
@clubby789 clubby789 changed the title Document Iterator::sum for Option/Result Document Iterator::sum/product for Option/Result Jan 4, 2023
@clubby789
Copy link
Contributor Author

Noticed that product was missing an example for both Option and Result so added one for each on their own page.

@the8472 the8472 assigned the8472 and unassigned m-ou-se Mar 20, 2023
@the8472
Copy link
Member

the8472 commented Mar 20, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 20, 2023

📌 Commit f321144 has been approved by the8472

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 Mar 20, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 21, 2023
…he8472

Document `Iterator::sum/product` for Option/Result

Closes rust-lang#105266

We already document the similar behavior for `collect()` so I believe it makes sense to add this too. The Option/Result implementations *are* documented on their respective pages and the page for `Sum`, but buried amongst many other trait impls which doesn't make it very discoverable.

`@rustbot` label +A-docs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2023
…he8472

Document `Iterator::sum/product` for Option/Result

Closes rust-lang#105266

We already document the similar behavior for `collect()` so I believe it makes sense to add this too. The Option/Result implementations *are* documented on their respective pages and the page for `Sum`, but buried amongst many other trait impls which doesn't make it very discoverable.

``@rustbot`` label +A-docs
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2023
…he8472

Document `Iterator::sum/product` for Option/Result

Closes rust-lang#105266

We already document the similar behavior for `collect()` so I believe it makes sense to add this too. The Option/Result implementations *are* documented on their respective pages and the page for `Sum`, but buried amongst many other trait impls which doesn't make it very discoverable.

```@rustbot``` label +A-docs
Noratrieb added a commit to Noratrieb/rust that referenced this pull request Mar 21, 2023
…he8472

Document `Iterator::sum/product` for Option/Result

Closes rust-lang#105266

We already document the similar behavior for `collect()` so I believe it makes sense to add this too. The Option/Result implementations *are* documented on their respective pages and the page for `Sum`, but buried amongst many other trait impls which doesn't make it very discoverable.

````@rustbot```` label +A-docs
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2023
Rollup of 10 pull requests

Successful merges:

 - rust-lang#106434 (Document `Iterator::sum/product` for Option/Result)
 - rust-lang#108326 (Implement read_buf for a few more types)
 - rust-lang#108842 (Enforce non-lifetime-binders in supertrait preds are not object safe)
 - rust-lang#108896 (new solver: make all goal evaluation able to be automatically rerun )
 - rust-lang#109124 (Add `dist.compression-profile` option to control compression speed)
 - rust-lang#109240 (Walk un-shifted nested `impl Trait` in trait when setting up default trait method assumptions)
 - rust-lang#109385 (fix typo)
 - rust-lang#109386 (add myself to mailmap)
 - rust-lang#109390 (Custom MIR: Support aggregate expressions)
 - rust-lang#109408 (not *all* retags might be explicit in Runtime MIR)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit caae551 into rust-lang:master Mar 21, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 21, 2023
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 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.

Iterator's .sum() and .product() should mention that they work on iterators over Result<T,E> and Option<T>
5 participants