Skip to content

Upgrading num-traits 0.1 to 0.2

Breaking0.1.43 → 0.2.19Breaking3Platform2New27Changed8Fixed5Other7

Fetching 20 releases from GitHub…19 / 20
BreakingUpgrade verdict

2 breaking changes and 2 platform requirement changes.

  • The library now has a switch called `std` that is on by default. If you turn it off, the library works without the standard library, but the `Float` and `Real` traits are no longer available.
  • Converting a float to an integer now safely fails with None when the value is too large, instead of producing undefined results.
  • [Upgrade to 2021 edition, MSRV 1.60][310].
  • This version requires Rust 1.31 or newer.
4 items need code or config changes

Requires Rust 1.60 from 0.2.19 (none stated before).

Adds autocfg ^1, libm ^0.2.0.

Drops num-traits.

Breaking2
Adds a default-enabled std feature; building without it makes the crate #![no_std], and Float and Real are only available with std.
stdFloatReal
Casting from floating point to integers now returns None on overflow, avoiding rustc's undefined behavior.
castNumCastFromPrimitiveToPrimitive
Platform2
[Upgrade to 2021 edition, MSRV 1.60][310].
Upgrades to the 2018 edition and raises the minimum supported Rust version to 1.31.