2 releases

0.1.1 May 22, 2022
0.1.0 May 22, 2022

#28 in #debugger

39 downloads per month
Used in enum_const

Apache-2.0

5KB
53 lines

enum_const

enum const trait

usage

use enum_const::EnumConst;

#[derive(EnumConst, PartialEq, Debug)]
enum Foo {
    X = 1,
    Y = 2,
    Z,
}

#[test]
fn it_works() {
    assert_eq!(Some(Foo::X), Foo::from_const_isize(1));
    assert_eq!(Some(1isize), Foo::X.get_const_isize());
}

Dependencies

~1.5MB
~34K SLoC