Skip to content

Commit

Permalink
[model] Support optional trailing comma in state! macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Mar 11, 2019
1 parent 6f0ab0f commit 96a92bd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions model/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ macro_rules! state {
$field_name:ident : $field_ty:ty
),*
}
) => {
$crate::state! {
$vis struct $state_name {
$(
$( #[$field_meta] )*
$field_name : $field_ty ,
)*
}
}
};
(
$( #[$state_meta:meta] )*
$vis:vis struct $state_name:ident {
$(
$( #[$field_meta:meta] )*
$field_name:ident : $field_ty:ty ,
)*
}
) => {
$( #[$state_meta] )*
$vis struct $state_name {
Expand Down

0 comments on commit 96a92bd

Please sign in to comment.