Cargo Features

[dependencies]
easy-cast = { version = "0.5.3", default-features = false, features = ["std", "libm", "always_assert", "assert_float", "assert_int", "assert_digits"] }

To build locally:
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --open

default = std

The std feature is set by default whenever easy-cast is added without default-features = false somewhere in the dependency tree.

std default

Without std, float conversions are disabled (unless libm is used)

Affects traits::ConvFloat, traits::CastFloat

libm

libm may be used instead of std to provide float conversions

Enables libm

Affects traits::ConvFloat, traits::CastFloat

always_assert = assert_digits, assert_float, assert_int

Note: assertions are always used in debug builds; these only affect release builds:

Always use all assertions

assert_float always_assert?

Assert float -> any conversions do not exceed range of target type

assert_int always_assert?

Always int -> int conversions do not exceed range of target type

assert_digits always_assert?

Assert int -> float conversion does not lose accuracy