Cargo Features

easy-cast = { version = "0.5.2", default-features = false, features = ["std", "always_assert", "assert_float", "assert_int", "assert_digits", "libm"] }
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

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

Features from optional dependencies

libm implicit feature

Enables libm


libm in pure Rust

Affects traits::ConvFloat, traits::CastFloat