Tracking issue for `str_split_at_unchecked`

Open
#165,545 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
backend

Research direction

Read the stabilization section of the Rust std-dev guide linked in the issue, then review the tracking issue and implementation PR #165546. The issue says OsStr::split_at_unchecked depends on #156199; check that dependency and the stabilization criteria before assessing readiness. Done means the stabilization PR is prepared for the listed APIs once the dependency is satisfied.

Written by the indexing model from the issue text.

Description

C-tracking-issue S-tracking-unimplemented T-libs

Feature gate: #![feature(str_split_at_unchecked)]

This is a tracking issue for exposing the split_at_unchecked and split_at_mut_unchecked on str and OsStr.

Public API
impl str {
    pub const unsafe fn split_at_unchecked(&self, mid: usize) -> (&str, &str);
    pub const unsafe fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut str, &mut str);
}

impl OsStr {
    pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&OsStr, &OsStr);
}
Remarks

OsStr::split_at_unchecked needs to stabilize after #156199.

Steps / History
  • ACP: rust-lang/libs-team#938
  • Implementation: #165546
  • Stabilization PR^1
Unresolved Questions
  • None yet.
Dominant language
Rust
Stars
121k
Forks
17.3k
Avg merge
2d 21h
Merged PRs (30d)
531

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/rust

All issues in rust-lang/rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.