-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
FromIterator probably shouldn't say "rarely called explicitly" when it's in the prelude #90107
Copy link
Copy link
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The documentation for
FromIteratorhttps://doc.rust-lang.org/nightly/std/iter/trait.FromIterator.html saysHowever, the trait is now in the rust_2021 prelude https://doc.rust-lang.org/nightly/core/prelude/rust_2021/index.html explicitly to allow it to be called more often.
This documentation should thus likely be updated to -- while still pointing at
collect-- mention why one may wish to call it explicitly. Perhaps something likeVecDeque::from_iter(0..100)would be a nice example.One might also re-use some text from the RFC that added it to the prelude, https://rust-lang.github.io/rfcs/3114-prelude-2021.html#fromiterator