-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(os_str_slice)]
This is a tracking issue for an API for taking substrings of OsStr
, which in combination with OsStr::as_encoded_bytes()
would make it possible to implement most string operations in (portable) safe code.
Public API
impl OsStr {
pub fn slice_encoded_bytes<R: ops::RangeBounds<usize>>(&self, range: R) -> &Self;
}
Steps / History
- ACP: ACP: A substring API for
OsStr
libs-team#306 - Implementation: Add substring API for
OsStr
#118484, MoveOsStr::slice_encoded_bytes
validation to platform modules #118569 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Currently this enforces the same requirements on all platforms, but on Unix (and some other platforms) the internal encoding of
OsStr
is already fully specified to be arbitrary bytes by means of theOsStrExt
trait. Should we:- Relax the requirements on these platforms,
- Keep enforcing the lowest common denominator invariants, or
- Use strict checks now, but leave the possibility of relaxing them later?
Footnotes
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.