cheque 0.3.0

Convenient checked math
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented1 out of 2 items with examples
  • Size
  • Source code size: 5.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • purpleposeidon

Provides a macro allow natural usage of checked math.

Documentation.

let a = 5u8;
let b = 20u8;
let z = 0u8;
 
checked_wrap![a, b, z];
 
assert_eq!(*(a + b), Some(25));
assert_eq!(*(b * b), None);
assert_eq!(*(a - b), None);
assert_eq!(*(b / z), None);
assert_eq!(*(a - 20), None);
assert_eq!(*((a - b) + 1), None);