Closed
Description
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.