Crates.io | btoi |
lib.rs | btoi |
version | 0.4.3 |
source | src |
created_at | 2017-09-29 17:23:34.685055 |
updated_at | 2023-02-18 20:13:18.921147 |
description | Parse integers directly from ASCII byte slices |
homepage | |
repository | https://github.com/niklasf/rust-btoi |
max_upload_size | |
id | 33922 |
size | 37,417 |
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]
.
use btoi::btoi;
assert_eq!(Ok(42), btoi(b"42"));
assert_eq!(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.