]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #95644 - WaffleLapkin:str_split_as_str_refactor_take2, r=Amanieu
authorbors <bors@rust-lang.org>
Tue, 3 Jan 2023 11:06:08 +0000 (11:06 +0000)
committerbors <bors@rust-lang.org>
Tue, 3 Jan 2023 11:06:08 +0000 (11:06 +0000)
`Split*::as_str` refactor

I've made this patch almost a year ago, so the rename and the behavior change are in one commit, sorry ðŸ˜…

This fixes #84974, as it's required to make other changes work.

This PR
- Renames `as_str` method of string `Split*` iterators to `remainder` (it seems like the `as_str` name was confusing to users)
- Makes `remainder` return `Option<&str>`, to distinguish between "the iterator is exhausted" and "the tail is empty", this was [required on the tracking issue](https://github.com/rust-lang/rust/issues/77998#issuecomment-832696619)

r? `@m-ou-se`

1  2 
library/core/src/lib.rs

Simple merge