mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 17:26:12 +00:00
feat: Update method signature of int_from_ascii * Tracking issue: rust-lang/rust#134821 Following [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/327149-t-libs-api.2Fapi-changes/topic/How.20to.20proceed.20with.20int_from_ascii/with/611508226) it appears the preference is to change the API for this feature as follows: ```rust // core::num impl X { pub const fn from_ascii_bytes<T>(src: T) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; pub const fn from_ascii_bytes_radix<T>(src: T, radix: u32) -> Result<X, ParseIntError> where T: [const] AsRef<[u8]> + [const] core::marker::Destruct; } ``` and similarly for `NonZero<X>`. Reasons behind the change: * Future-proof the naming convention for future string-like types * Support the upcoming `ByteStr`/`ByteString` types: rust-lang/rust#134915 This pull request applies this change. The const-ness of these functions is now feature gated behind rust-lang/rust#143773