-
-
Notifications
You must be signed in to change notification settings - Fork 14.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(int_from_ascii)]
This is a tracking issue for int_from_ascii, providing equivalent methods to {usize,u8,u16,u32,u64,u128,isize,i8,i16,i32,i64,i128}::from_str() and from_str_radix() that allow working directly on byte slices, in order to skip UTF-8 validation.
Public API
For each integer type T (usize, u8, u16, u32, u64, u128, isize, i8, i16, i32, i64, i128):
// core::num
impl T {
pub const fn from_ascii(src: &[u8]) -> Result<T, ParseIntError>;
pub const fn from_ascii_radix(src: &[u8], radix: u32) -> Result<T, ParseIntError>;
}
impl NonZero<T> {
pub const fn from_ascii(src: &[u8]) -> Result<Self, ParseIntError>;
pub const fn from_ascii_radix(src: &[u8], radix: u32) -> Result<Self, ParseIntError>;
}Steps / History
- Abandoned implementation: Implement int_from_ascii_radix #105206
- API change proposal: Add from_bytes_radix function libs-team#469
- Implementation for
T: Implementint_from_ascii(#134821) #134824 - Implementation for
NonZero<T>: feat: Implementint_from_asciiforNonZero<T>#152267 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Stabilize Tracking Issue for
nonzero_from_str_radix#152193 first
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 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.