Crates.io | btoi |
lib.rs | btoi |
version | |
source | src |
created_at | 2017-09-29 17:23:34.685055 |
updated_at | 2025-01-04 20:26:22.916182 |
description | Parse integers directly from ASCII byte slices |
homepage | |
repository | https://github.com/niklasf/rust-btoi |
max_upload_size | |
id | 33922 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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"));
core::error::Error
for ParseIntegerError
.#[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.