Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FromBytesRadix trait + impl + error types #120

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

alexjago
Copy link

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.

src/from_bytes_radix.rs Outdated Show resolved Hide resolved
src/from_bytes_radix.rs Outdated Show resolved Hide resolved
src/from_bytes_radix.rs Show resolved Hide resolved
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.

None yet

2 participants