Parse integers from ASCII byte slices.
Provides functions similar to from_str_radix
,
but is faster when parsing directly from byte slices instead of strings.
Supports #![no_std]
.
```rust use btoi::btoi;
asserteq!(Ok(42), btoi(b"42")); asserteq!(Ok(-1000), btoi(b"-1000")); ```
#[track_caller]
.!#[deny(warnings)]
, which is is a forwards compability hazard
in libraries.!#[forbid(unsafe_code)]
.-
was parsed as zero, but should have errored. Thanks @wayslog.u32
(from u8
) to mirror the standard library.#[inline]
generic functions.std
. Disable for #![no_std]
support.#[inline]
.btoi is dual licensed under the Apache 2.0 and MIT license, at your option.