Skip to content

Tracking issue for str::split_ascii_whitespace #48656

Closed
@clarfonthey

Description

@clarfonthey

Implemented in #49987:

impl str {
    pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace {}
}

#[derive(Clone, Debug)]
pub struct SplitAsciiWhitespace<'a> {}

impl<'a> Iterator for SplitAsciiWhitespace<'a> {
    type Item = &'a str;}
impl<'a> DoubleEndedIterator for SplitAsciiWhitespace<'a> {}
impl<'a> FusedIterator for SplitAsciiWhitespace<'a> {}

Original feature request:


Considering how is_ascii_whitespace is now available on libcore, it makes sense to provide this too.

I'll provide a PR at some point if this seems reasonable; a lot of code that needs to split on whitespace only needs to split on ASCII whitespace, which is considerably faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-iteratorsArea: IteratorsC-tracking-issueCategory: 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.disposition-mergeThis 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions