-
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(utf8_chunks)]
This is a tracking issue for an improved API for str::from_utf8
.
Public API
// core::str
pub struct Utf8Chunks<'a> { ... }
impl<'a> Utf8Chunks<'a> {
pub fn new(bytes: &'a [u8]) -> Self;
}
impl<'a> Iterator for Utf8Chunks<'a> {
type Item = Utf8Chunk<'a>;
}
impl<'a> Clone for Utf8Chunks<'a>;
impl<'a> Debug for Utf8Chunks<'a>;
impl<'a> FusedIterator for Utf8Chunks<'a>;
pub struct Utf8Chunk<'a> { ... }
impl<'a> Utf8Chunk<'a> {
pub fn valid(&self) -> &'a str;
pub fn invalid(&self) -> &'a [u8];
}
impl<'a> Clone for Utf8Chunk<'a>;
impl<'a> Debug for Utf8Chunk<'a>;
impl<'a> PartialEq for Utf8Chunk<'a>;
impl<'a> Eq for Utf8Chunk<'a>;
Steps / History
- Proposal: Expose
Utf8LossyChunksIter
libs-team#54 - Implementation: Expose
Utf8Lossy
asUtf8Chunks
#99544 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Should the constructor be
Utf8Chunks::new
or<[u8]>::utf8_chunks
? - Should
Utf8Chunks::debug
or a similar method be exposed?
Footnotes
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.