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
//! This example shows how you can create an enum from a range expression.

use matched_enums::Matched;

#[derive(Matched, PartialEq, Eq, Debug, Ord, PartialOrd)]
#[matched_enum(value_type=isize)]
enum Signature {
    #[matches(1..)]
    Positive = 1,

    #[matches(..=-1)]
    Negative = -1,

    #[matches(0..1)]
    Zero = 0,
}

fn main() {
    let sign = Signature::from(-42); // Assign arbitrary negative value.
    assert!(sign == Signature::Negative); // It is expected that the negactive value is... negative.
    assert!(sign < Signature::Zero); // It is also expected that negative is below zero.

    let sign = Signature::from(0);
    assert!(sign < Signature::Positive);
    assert!(sign == Signature::Zero);
    assert!(sign > Signature::Negative);
}