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 new recommended use of FromIterator::from_iter #94587

Merged
merged 3 commits into from
Mar 10, 2022

Conversation

JKAnderson409
Copy link

#90107
Most of the added prose was paraphrased from the links provided in the issue. The suggested VecDeque example seemed to make the point well enough so I just used that.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @scottmcm (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 4, 2022
@ChayimFriedman2
Copy link
Contributor

Are you sure the example need to be on collect()'s docs? I feel it's better suited for FromIterator.

@JKAnderson409
Copy link
Author

collect() is not defined in that file. The issue only pertained to the documentation of the trait so that's what I changed. FromIterator is defined in collect.rs and Iterator::collect() is defined in iterator.rs.

Copy link
Member

@scottmcm scottmcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up! I think this is a good direction, just have a few tweak requests.

When updated, please comment @rustbot ready to re-mark it for review again.

library/core/src/iter/traits/collect.rs Outdated Show resolved Hide resolved
library/core/src/iter/traits/collect.rs Outdated Show resolved Hide resolved
@scottmcm scottmcm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 4, 2022
@JKAnderson409
Copy link
Author

@rustbot ready

Let me know if there are still tweaks you see to improve this. I think the explicitness of mentioning the turbofish is better than referring broadly to type inference.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 4, 2022
@JKAnderson409 JKAnderson409 requested a review from scottmcm March 10, 2022 01:18
@scottmcm
Copy link
Member

Thanks! I like this new phrasing.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 10, 2022

📌 Commit b363f13 has been approved by scottmcm

@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 10, 2022
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Mar 10, 2022
…ottmcm

Document new recommended use of `FromIterator::from_iter`

rust-lang#90107
Most of the added prose was paraphrased from the links provided in the issue. The suggested `VecDeque` example seemed to make the point well enough so I just used that.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 10, 2022
…ottmcm

Document new recommended use of `FromIterator::from_iter`

rust-lang#90107
Most of the added prose was paraphrased from the links provided in the issue. The suggested `VecDeque` example seemed to make the point well enough so I just used that.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2022
…askrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#94440 (Better error for normalization errors from parent crates that use `#![feature(generic_const_exprs)]`)
 - rust-lang#94587 (Document new recommended use of `FromIterator::from_iter`)
 - rust-lang#94644 (Fix soundness issue in scoped threads.)
 - rust-lang#94740 (Unify impl blocks by wrapping them into a div)
 - rust-lang#94753 (Improve rustdoc book)
 - rust-lang#94796 (Allow `cargo run` instead of `cargo run -p bootstrap`)
 - rust-lang#94805 (Revert accidental stabilization)
 - rust-lang#94809 (RustWrapper: add missing include)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b512720 into rust-lang:master Mar 10, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 10, 2022
@scottmcm
Copy link
Member

Congrats on your first PR landing, @JKAnderson409 !

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants