| Crates.io | multi_compare |
| lib.rs | multi_compare |
| version | 0.1.0 |
| created_at | 2025-03-14 01:16:40.936797+00 |
| updated_at | 2025-03-14 01:16:40.936797+00 |
| description | Macro for comparing multiple values in a concise way. (a < b < c) |
| homepage | |
| repository | https://github.com/Tomyyy-1337/multi_compare |
| max_upload_size | |
| id | 1591696 |
| size | 4,727 |
This crate provides a macro to compare multiple values in a single expression without
the need for the && operator and without duplicating values.
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));
}