rust/library/core/src/str
Dylan DPC f7febc8865
Rollup merge of #82570 - WaffleLapkin:split_whitespace_as_str, r=m-ou-se
Add `as_str` method for split whitespace str iterators

This PR adds `as_str` methods to `SplitWhitespace` and `SplitAsciiWhitespace`
str iterators. The methods return the remainder, similar to `as_str` methods on
`Chars` and other split iterators. This PR is a continuation of https://github.com/rust-lang/rust/pull/75265, which added `as_str` for all other str split iterators.

The feature gate for new methods is `#![feature(str_split_whitespace_as_str)]`.

`SplitWhitespace` and `SplitAsciiWhitespace` use iterators under the hood, so to implement `as_str` it's required to either
1. Make fields of some iterators `pub(crate)`
2. Add getter methods (like `into_inner`, `inner`, `inner_mut`...) to some (all) iterators
3. Completely rewrite `SplitWhitespace` and `SplitAsciiWhitespace`

This PR uses the 1. approach since it's easier to implement and requires fewer changes (and no changes to the public API). If you think that's not the right way, please, tell me.

r? `@m-ou-se`
2021-03-19 23:01:35 +01:00
..
converts.rs Convert primitives to use intra-doc links 2021-02-25 20:31:53 -05:00
error.rs Add #[inline] to the Utf8Error accessors. 2020-10-18 15:38:32 +02:00
iter.rs Rollup merge of #82570 - WaffleLapkin:split_whitespace_as_str, r=m-ou-se 2021-03-19 23:01:35 +01:00
lossy.rs Move utf-8 validating helpers to new mod 2020-09-26 05:20:53 +00:00
mod.rs Stabilize str_split_once 2021-02-09 23:17:11 -05:00
pattern.rs Fixed some intra-docs links in library/core 2020-09-18 07:49:29 +08:00
traits.rs Convert the rest of the standard library primitives to intra-doc links 2021-02-25 20:32:49 -05:00
validations.rs Remove semicolon from internal err macro 2020-11-18 23:10:35 -05:00