Code reorganisation and field support

This commit is contained in:
Zac Pullar-Strecker 2020-09-01 20:26:10 +12:00
parent a14194b428
commit 974518fde7
6 changed files with 105 additions and 60 deletions

View file

@ -18,7 +18,13 @@ macro_rules! format_to {
};
}
// Generates `From` impls for `Enum E { Foo(Foo), Bar(Bar) }` enums
/// Generates `From` impls for `Enum E { Foo(Foo), Bar(Bar) }` enums
///
/// # Example
///
/// ```rust
/// impl_from!(Struct, Union, Enum for Adt);
/// ```
#[macro_export]
macro_rules! impl_from {
($($variant:ident $(($($sub_variant:ident),*))?),* for $enum:ident) => {