cmp_macro 0.1.0

This macro allows you to write a summary comparison, just like in Python.
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented10 out of 10 items with examples
  • Size
  • Source code size: 20.35 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.38 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Namacha411/cmp-macro
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Namacha411

cmp-macro

This macro allows you to write a summary comparison, just like in Python.

example

use cmp_macro::{le, lety};

fn main() {
    let x = 3;
    if le!(1, x, 4) {
        println!("1 <= x <= 4");
    }

    if lety!(i32; -2.0, -1, x, 4, 5.0) {
        println!("-2 <= -1 <= x <= 4 <= 5");
    }
}