Skip to content

Tracking Issue for osstr_split_at #156199

@ChrisDenton

Description

@ChrisDenton

Feature gate: #![feature(osstr_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.)

Unresolved Questions

  • On platforms where OsStr is just bytes (e.g. Unix), should it allow splitting at arbitrary indexes? However, this would mean that you could safely write non-portable code using OsStr.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions