aboutsummaryrefslogtreecommitdiff
path: root/crates/stdx/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/stdx/src/macros.rs')
-rw-r--r--crates/stdx/src/macros.rs8
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]
23macro_rules! impl_from { 29macro_rules! impl_from {
24 ($($variant:ident $(($($sub_variant:ident),*))?),* for $enum:ident) => { 30 ($($variant:ident $(($($sub_variant:ident),*))?),* for $enum:ident) => {