btoi
Parse integers from ASCII byte slices.
Introduction
Provides functions similar to from_str_radix,
but is faster when parsing directly from byte slices instead of strings.
Supports #![no_std].
use btoi;
assert_eq!;
assert_eq!;
Documentation
MSRV policy
The minimum supported Rust version is 1.60, matching
num_traits,
with no intent to ever increase it.
That's because
#![feature(int_from_ascii)]
in the standard library will hopefully eventually make this crate obsolete
for new versions of Rust, and so old versions are the priority.
Changelog
- 0.5.0
- Tweak error messages and expose
ParseIntegerErrorKindviaParseIntegerError::kind().
- Tweak error messages and expose
- 0.4.4 (yanked due to unintended MSRV bump)
Implementcore::error::ErrorforParseIntegerError.
- 0.4.3
- Use
#[track_caller].
- Use
- 0.4.2
- No longer
!#[deny(warnings)], which is is a forwards compability hazard in libraries. - Explicit
!#[forbid(unsafe_code)].
- No longer
- 0.4.1
-was parsed as zero, but should have errored. Thanks @wayslog.
- 0.4.0
- Change type of radix to
u32(fromu8) to mirror the standard library. - No need to
#[inline]generic functions.
- Change type of radix to
- 0.3.0
- New default feature
std. Disable for#![no_std]support. - Mark functions as
#[inline].
- New default feature
- 0.2.0
- No longer reexport num-traits.
- 0.1.3
- Update to num-traits 0.2 (semver compatible).
- 0.1.2
- Fix documentation warnings.
- Update dependencies.
- 0.1.1
- Documentation fixes.
- 0.1.0
- Initial release.
License
btoi is dual licensed under the Apache 2.0 and MIT license, at your option.