3 releases
0.1.6 | Nov 15, 2024 |
---|---|
0.1.5 | Sep 6, 2024 |
0.1.3 | Aug 23, 2024 |
#331 in Procedural macros
159 downloads per month
10KB
197 lines
enum_from_derive
example:
use enum_from_derive::From;
#[repr(i32)]
#[derive(From, Debug)]
pub enum Test {
#[default]
Name,
#[from_str(test)]
#[False]
Test = 100,
#[False]
TTT,
#[True]
FFF = 1000
}
#[test]
fn test() {
let t = Test::from("test1");
println!("{:?}", t);
let t = Test::from(100);
println!("{:?}", t);
println!("{}", a.to_bool())
}
Dependencies
~220–660KB
~16K SLoC