Skip to content

Steer docs to utf8_chunks and Iterator::take #140598

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

ShE3py
Copy link
Contributor

@ShE3py ShE3py commented May 2, 2025

@rustbot label +A-docs

@rustbot
Copy link
Collaborator

rustbot commented May 2, 2025

r? @workingjubilee

rustbot has assigned @workingjubilee.
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. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels May 2, 2025
@workingjubilee
Copy link
Member

workingjubilee commented May 2, 2025

I have never seen "lfold", only "foldl". I am aware that Rust has rfold but every other usage I know of (Haskell, etc.) has it as foldr. I have also never seen either lfind or findl. The primary use-case of these aliases is for relating idioms and functions from beyond Rust, not Rust-to-Rust, and even then they are focused on relatively common idioms and not exhaustively documenting every single language's terminology in our aliases. So I do not think we should add things "for symmetry", and would prefer to review the rest of the changes on their own merit, without such "for symmetry" changes included.

@workingjubilee
Copy link
Member

workingjubilee commented May 2, 2025

I have other thoughts about those aliases but going on seems unnecessary if that is sufficient as explanation?

In particular, I do think the "limit" alias is well-motivated, though I will still have to review it in light of the doc alias policy.

And obviously the utf8_chunks-related doc-update is simply correct.

@ShE3py
Copy link
Contributor Author

ShE3py commented May 2, 2025

Tbh I just saw foldl and added the rest for completeness, but yeah they might been unusual, and anyway they're only a letter apart so autocompletion/rustc/rustdoc will suggest the right one. Reverting those ones.

Original PR description for context:

  • Adds lfind / findl as an alias of find (for symmetry with DoubleEndedIterator’s rfind), likewise for fold.

@ShE3py ShE3py force-pushed the iter-misc-docs branch from 049b587 to 415a73e Compare May 2, 2025 21:43
@workingjubilee
Copy link
Member

I do understand the desire to complete the pattern. I have spent an unnecessary amount of time making sure that match arms align, and rustfmt can't stop me there, it just means that I try to write the code so that the match arms align inherently instead of adding in spaces to make it happen.

@workingjubilee
Copy link
Member

the existence of io::Take::limit is seriously testing my patience with the 1.0 Rust io/fs code.

@workingjubilee workingjubilee changed the title Minor tweaks to Iterator's docs Steer docs to utf8_chunks and Iterator::take May 5, 2025
@workingjubilee
Copy link
Member

I just looked at the clash of the fifteen zillion documented instances of popcnt in doc search, so I am not going to take seriously any idea that a name collision is a problem in the limit case.

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 5, 2025

📌 Commit 415a73e has been approved by workingjubilee

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 May 5, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request May 6, 2025
…bilee

Steer docs to `utf8_chunks` and `Iterator::take`

- Adds `limit` as an alias of `take` (as this is [what Java calls this operation](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#limit-long-));
- Says that [`Utf8Chunks`](https://doc.rust-lang.org/std/str/struct.Utf8Chunks.html) comes from [`[u8]::utf8_chunks`](https://doc.rust-lang.org/std/primitive.slice.html#method.utf8_chunks).

`@rustbot` label +A-docs
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#139550 (Fix `-Zremap-path-scope` rmeta handling)
 - rust-lang#139773 (Implement `Iterator::last` for `vec::IntoIter`)
 - rust-lang#140035 (Implement RFC 3503: frontmatters)
 - rust-lang#140176 (Fix linking statics on Arm64EC)
 - rust-lang#140251 (coverage-dump: Resolve global file IDs to filenames)
 - rust-lang#140393 (std: get rid of `sys_common::process`)
 - rust-lang#140532 (Fix RustAnalyzer discovery of rustc's `stable_mir` crate)
 - rust-lang#140598 (Steer docs to `utf8_chunks` and `Iterator::take`)
 - rust-lang#140634 (Use more accurate ELF flags on MIPS)
 - rust-lang#140673 (Clean rustdoc tests folder)
 - rust-lang#140678 (Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis)
 - rust-lang#140687 (Update mdbook to 0.4.49)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#139550 (Fix `-Zremap-path-scope` rmeta handling)
 - rust-lang#139764 (Consistent trait bounds for ExtractIf Debug impls)
 - rust-lang#139773 (Implement `Iterator::last` for `vec::IntoIter`)
 - rust-lang#140035 (Implement RFC 3503: frontmatters)
 - rust-lang#140251 (coverage-dump: Resolve global file IDs to filenames)
 - rust-lang#140393 (std: get rid of `sys_common::process`)
 - rust-lang#140532 (Fix RustAnalyzer discovery of rustc's `stable_mir` crate)
 - rust-lang#140598 (Steer docs to `utf8_chunks` and `Iterator::take`)
 - rust-lang#140634 (Use more accurate ELF flags on MIPS)
 - rust-lang#140673 (Clean rustdoc tests folder)
 - rust-lang#140678 (Be a bit more relaxed about not yet constrained infer vars in closure upvar analysis)
 - rust-lang#140687 (Update mdbook to 0.4.49)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6238555 into rust-lang:master May 6, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone May 6, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2025
Rollup merge of rust-lang#140598 - ShE3py:iter-misc-docs, r=workingjubilee

Steer docs to `utf8_chunks` and `Iterator::take`

- Adds `limit` as an alias of `take` (as this is [what Java calls this operation](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#limit-long-));
- Says that [`Utf8Chunks`](https://doc.rust-lang.org/std/str/struct.Utf8Chunks.html) comes from [`[u8]::utf8_chunks`](https://doc.rust-lang.org/std/primitive.slice.html#method.utf8_chunks).

``@rustbot`` label +A-docs
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.

4 participants