matched_enums 1.3.0

A macro that provides the option to bin enum attribute to match-statements. This makes it easier to convert values into enums.
Documentation
//! Highlights how the macro deal with ranges that are not fully covered.

use matched_enums::Matched;

#[derive(Matched, Debug, PartialEq)]
#[matched_enum(use_partial=true, value_type=isize)]
enum PartialCoverage {
    #[matches(..-10)]
    Foo,

    #[matches(10 ..)]
    Bar,
}

fn main() {
    // Matched cases
    assert_eq!(PartialCoverage::try_from(-451), Ok(PartialCoverage::Foo));
    assert_eq!(PartialCoverage::try_from(451), Ok(PartialCoverage::Bar));

    // Unmatched case
    assert!(PartialCoverage::try_from(2).is_err());
}