enum-from-variant crate provides the EnumFromVariant macro, which simplifies the generation of the From trait for converting one enum variant to another enum variant. This is particularly useful when you need to handle error conversions or map different enum types in your Rust code.
USAGE:
Consider the following example where we convert between different enum types using the EnumFromVariant macro:
use EnumFromVariant;
use Display;
Limitations
Current Support: The macro only supports enum variants with basic inner types like String and other enums.
Unsupported Types: Tuple variants, struct variants, and more complex inner types are not supported at this time.