diff options
| author | bors <bors@rust-lang.org> | 2023-12-02 20:02:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-02 20:02:15 +0000 |
| commit | d5fab33766917085588d9bb4fb9477776695d98b (patch) | |
| tree | e776f6673e335c616df19f544406adaf23aa69f2 /compiler/rustc_codegen_llvm/src | |
| parent | 3f1e30a0a595f1d29fb10d41d9a58811ffdefb6a (diff) | |
| parent | 729851ef9e746473a2e7cbe20564383433b5e376 (diff) | |
| download | rust-d5fab33766917085588d9bb4fb9477776695d98b.tar.gz rust-d5fab33766917085588d9bb4fb9477776695d98b.zip | |
Auto merge of #118484 - blyxxyz:os-str-slice, r=BurntSushi
Add substring API for `OsStr`
This adds a method for taking a substring of an `OsStr`, which in combination with [`OsStr::as_encoded_bytes()`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html#method.as_encoded_bytes) makes it possible to implement most string operations in safe code.
API:
```rust
impl OsStr {
pub fn slice_encoded_bytes<R: ops::RangeBounds<usize>>(&self, range: R) -> &Self;
}
```
Motivation, examples and research at https://github.com/rust-lang/libs-team/issues/306.
Tracking issue: #118485
cc `@epage`
r? libs-api
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
