Skip to content

Tracking issue for str::split_ascii_whitespace #48656

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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-api[DEPRECATED; DO NOT USE]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