about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-03-19 23:01:35 +0100
committerGitHub <noreply@github.com>2021-03-19 23:01:35 +0100
commitf7febc8865a2cb2287b034f6588d7617fa0fc6e9 (patch)
tree83193b13f7b471f7e129851f49e351d855d43d7e /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
parentae1a2df255d747423d2a7f2be270c7927cf48874 (diff)
parentd4fd8538cb01f8be6083d2597a294c673f968290 (diff)
downloadrust-f7febc8865a2cb2287b034f6588d7617fa0fc6e9.tar.gz
rust-f7febc8865a2cb2287b034f6588d7617fa0fc6e9.zip
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`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions