diff options
author | Zac Pullar-Strecker <[email protected]> | 2020-09-01 09:26:10 +0100 |
---|---|---|
committer | Zac Pullar-Strecker <[email protected]> | 2020-10-08 03:04:20 +0100 |
commit | 974518fde7975b839ed4ccd4c5ce1d48cd6db3c7 (patch) | |
tree | cf25ef47c5531ca9934842a963afaabe78fc525f /crates/stdx/src | |
parent | a14194b428efdb09cc45f9862ec34bef0038cd35 (diff) |
Code reorganisation and field support
Diffstat (limited to 'crates/stdx/src')
-rw-r--r-- | crates/stdx/src/macros.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/stdx/src/macros.rs b/crates/stdx/src/macros.rs index bf298460f..f5ee3484b 100644 --- a/crates/stdx/src/macros.rs +++ b/crates/stdx/src/macros.rs | |||
@@ -18,7 +18,13 @@ macro_rules! format_to { | |||
18 | }; | 18 | }; |
19 | } | 19 | } |
20 | 20 | ||
21 | // Generates `From` impls for `Enum E { Foo(Foo), Bar(Bar) }` enums | 21 | /// Generates `From` impls for `Enum E { Foo(Foo), Bar(Bar) }` enums |
22 | /// | ||
23 | /// # Example | ||
24 | /// | ||
25 | /// ```rust | ||
26 | /// impl_from!(Struct, Union, Enum for Adt); | ||
27 | /// ``` | ||
22 | #[macro_export] | 28 | #[macro_export] |
23 | macro_rules! impl_from { | 29 | macro_rules! impl_from { |
24 | ($($variant:ident $(($($sub_variant:ident),*))?),* for $enum:ident) => { | 30 | ($($variant:ident $(($($sub_variant:ident),*))?),* for $enum:ident) => { |