macro_rules! impl_display { ($enum:ident<$lt:lifetime>, {$($variant:pat => $fmt_string:expr),+$(,)* }) => { ... }; ($enum:ident, {$($variant:pat => $fmt_string:expr),+$(,)* }) => { ... }; }
Expand description
Implement Display
for an enum.
Example usage:
enum Foo<'a> {
Bar(&'a str)
Baz(i32)
}
impl_display!{ Foo<'a>, {
Bar(s) => s,
Baz(i) => format!("{}", i)
}}