derive-from-one
Autogeneration of From impls for enums and structs.
Installation
Add to Cargo.toml:
= "0.1"
Usage
This macro generates From impls for enum constructors with a single field.
If you don't want some impls to be generated, apply #[from(skip)] to this tag.
Also, the macro would automatically skip ambiguous types, i.e., when a type appears in multiple tags regardless of amount of fields.
Example:
use FromOne;
Generated code:
You can also apply this macro to structs with a single field.
use FromOne;
;
License
MIT.