multi_compare 0.1.0

Macro for comparing multiple values in a concise way. (a < b < c)
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented2 out of 2 items with examples
  • Size
  • Source code size: 4.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.15 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Tomyyy-1337/multi_compare
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Tomyyy-1337

Multi-Compare

This crate provides a macro to compare multiple values in a single expression without the need for the && operator and without duplicating values.

Example

use multi_compare::c;
 
fn main (){
    let mut a = 5;
    let mut b = 10;
    let mut c = 18;
     
    assert!(c!(a < b <= c));    
    assert!(c!(1 <= a < b <= c < 20));    
}