cmp_macro

Crates.iocmp_macro
lib.rscmp_macro
version0.1.0
sourcesrc
created_at2022-02-20 16:03:28.949505
updated_at2022-02-20 16:03:28.949505
descriptionThis macro allows you to write a summary comparison, just like in Python.
homepage
repositoryhttps://github.com/Namacha411/cmp-macro
max_upload_size
id535808
size20,665
(Namacha411)

documentation

README

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");
    }
}
Commit count: 12

cargo fmt