Cargo Features
[dependencies]
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 whenevereasy-cast
is added without
somewhere in the dependency tree.default-features = false - 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