Clarify that match_indices returns an iterator over byte indices
Open
@zepredos is already working on this.
Since Aug 26, 2026.
A-docs
needs-triage
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Location (URL)
Docs: https://doc.rust-lang.org/stable/std/string/struct.String.html#method.match_indices
Summary
The comment at:
https://github.com/rust-lang/rust/blob/3ffb26fbf5bf232cf59e314e75ea325973f4f583/library/core/src/str/mod.rs#L2086-L2087
Could clarify:
/// Returns an iterator over the disjoint matches of a pattern within this string
- /// slice as well as the index that the match starts at.
+ /// slice as well as the byte index that the match starts at.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.