-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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 RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-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(str_first_last_char)]
This is a tracking issue for methods for extracting the first or last character of a str as a char. PR #89603 was submitted in 2021 (predating ACPs) but was closed after a few months due to author inactivity. ACP #764 proposes trying again to add these methods, this time constified.
Public API
// core::str
impl str {
pub const fn first_char(&self) -> Option<char>
pub const fn last_char(&self) -> Option<char>
pub const fn split_first_char(&self) -> Option<(char, &str)>
pub const fn split_last_char(&self) -> Option<(char, &str)>
}Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: Add
str::split_firstand others libs-team#764 - Implementation: libcore: add
str::first,str::split_first,str::lastandstr::split_lastmethods #89603 (abandoned) - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
_charsuffix or not?
Footnotes
Reactions are currently unavailable
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 RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.