[package]
authors = ["Alex Huszagh <ahuszagh@gmail.com>"]
autobenches = false
categories = ["parsing", "encoding", "no-std"]
description = "Lexical, to- and from-string conversion routines."
documentation = "https://docs.rs/lexical-core"
keywords = ["parsing", "lexical", "encoding", "no_std"]
license = "MIT/Apache-2.0"
name = "lexical-core"
readme = "README.md"
repository = "https://github.com/Alexhuszagh/rust-lexical/tree/master/lexical-core"
version = "0.4.8"
build = "build.rs"

# TODO(ahuszagh) Dependency Versioning and Rustc Roadmap:
#   - Update cfg-if to "0.1.10" when we support only Rustc >= 1.32.0.

# We want FFI support, so build a regular lib, a system static lib,
# and a system shared lib.
[lib]
crate-type = ["lib", "staticlib", "cdylib"]

[badges]
travis-ci = { repository = "Alexhuszagh/rust-lexical" }

[dependencies]
cfg-if = "0.1"
static_assertions = "0.3.3"
# Use arrayvec for the correct parser.
arrayvec = { version = "0.4", optional = true, features = ["array-sizes-33-128"] }
# Optimized Grisu3 implementation, a well-tested, correct algorithm.
dtoa = { version = "0.4", optional = true }
# Optimized Ryu implementation, the fastest correct algorithm.
ryu = { version = "^1.0", optional = true }
# Enable quickcheck for newer Rustc versions.
quickcheck = { version = "0.8.5", optional = true }
# Enable proptest for newer Rustc versions.
proptest = { version = "0.9.4", optional = true }

[dev-dependencies]
approx = "0.3.0"

[build-dependencies]
rustc_version = "0.2"

[features]
default = ["correct", "ryu", "std"]
# Use the correct atof parser.
correct = ["arrayvec", "table"]
# Use the optimized Grisu3 implementation from dtoa (not recommended).
grisu3 = ["dtoa"]
# Add support for parsing non-decimal float and integer strings.
radix = []
# Allow custom rounding schemes, at the cost of slower performance.
rounding = []
# Use the `std` library.
std = []
# Use precompiled tables for faster performance and accuracy, at the cost of larger binaries.
table = []
# Trim a trailing ".0" from an exported float string, and represent -0.0 as "0".
trim_floats = []
# Don't force bounds checking with indexing not-known to be valid at compile time.
# This may lead to memory safety issues.
unchecked_index = []
# Undocumented. Disable quickcheck for older Rustc versions.
property_tests = ["quickcheck", "proptest"]

# Use heavy optimizations for release builds, and make our panics to detect
# internal logic errors safe for FFI, via abort.
[profile.dev]
opt-level = 0
debug = true
lto = false
panic = 'abort'

[profile.release]
opt-level = 3
debug = false
debug-assertions = false
lto = true
panic = 'abort'
