Skip to content

Add FromBytesRadix trait + impl + error types#120

Open
alexjago wants to merge 8 commits intoBurntSushi:masterfrom
alexjago:master
Open

Add FromBytesRadix trait + impl + error types#120
alexjago wants to merge 8 commits intoBurntSushi:masterfrom
alexjago:master

Conversation

@alexjago
Copy link
Copy Markdown

This follows after discussion and work on #64.

Importing the trait FromBytesRadix will provide {integer}::from_bytes_radix(...) for integer types, analogous to {integer}::from_str_radix(...) but operating on an &dyn AsRef<[u8]> rather than an &str.

Error types ParseIntError and IntErrorKind are also provided, copying the standard library.
Note: IntErrorKind copies the post-1.55 version; once the crate MSRV is bumped it can probably be replaced with a simple pub use core::num::IntErrorKind.

alexjago and others added 2 commits July 22, 2022 18:42
Co-authored-by: Ryan Lopopolo <rjl@hyperbo.la>
Co-authored-by: Ryan Lopopolo <rjl@hyperbo.la>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants