-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
Feature gate: #![feature(char_indices_offset)]
This is a tracking issue for the function CharIndices::offset
. It returns the byte position of the next character, or the length of the underlying string if there are no more characters. This is useful for getting ranges over strings you're iterating over.
Public API
let mut chars = "a楽".char_indices();
assert_eq!(chars.offset(), 0);
assert_eq!(chars.next(), Some((0, 'a')));
assert_eq!(chars.offset(), 1);
assert_eq!(chars.next(), Some((1, '楽')));
assert_eq!(chars.offset(), 4);
assert_eq!(chars.next(), None);
Steps / History
- Implementation: Added CharIndices::offset function #82585
- Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
danaugrs, martin-sucha, jimblandy, pmetzger, lffg and 26 more
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.