literal-enum
Automatically implements the TryFrom<Literal>
trait and Into<Literal>
trait for an enum
where the literal
s must be the same type(one of [&'static str
, &'static [u8]
, u8
, char
, u32
, bool
])
Usage Example
use LiteralEnum;
assert_eq!;
let b: u8 = IncrementPointer.into;
assert_eq!;