Tracking Issue for `os_str_split_at`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(os_str_split_at)]
This is a tracking issue for OsStr::{split_at, split_at_checked}.
This allows splitting OsStr on a valid UTF-8 boundary cross-platform.
Public API
// std::ffi
impl OsStr {
// Panic if `mid` is not a valid boundary
pub const fn split_at(&self, mid: usize) -> (&OsStr, &OsStr);
// Returns `None` if `mid` is not a valid boundary
pub const fn split_at_checked(&self, mid: usize) -> Option<(&OsStr, &OsStr)>;
}
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: rust-lang/libs-team#780
- Implementation: #...
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- On platforms where
OsStris just bytes (e.g. Unix), should it allow splitting at arbitrary indexes? However, this would mean that you could safely write non-portable code usingOsStr.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the std::ffi::OsStr API and the proposed split_at and split_at_checked signatures under the os_str_split_at feature gate. Review the unresolved question about arbitrary byte-index splitting on Unix before determining the implementation scope. Done means the implementation is complete, the portability question is resolved, and the tracking checklist is updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100