Finite state machines in rust; bendns fork to add types.
Diffstat (limited to 'rust-fsm-dsl/src/parser.rs')
| -rw-r--r-- | rust-fsm-dsl/src/parser.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/rust-fsm-dsl/src/parser.rs b/rust-fsm-dsl/src/parser.rs index 7ea732d..3685200 100644 --- a/rust-fsm-dsl/src/parser.rs +++ b/rust-fsm-dsl/src/parser.rs @@ -106,7 +106,6 @@ impl Parse for TransitionDef { } } - struct ReprC { repr_c: Option<bool>, } @@ -120,20 +119,19 @@ impl Parse for ReprC { parenthesized!(entries_content in input); match entries_content.parse::<syn::Lit>() { Ok(syn::Lit::Bool(b)) => { - return Ok( ReprC { + return Ok(ReprC { repr_c: Some(b.value()), }); - }, + } _ => { return Err(Error::new_spanned(kw_repr_c, "Invalid repr_c argument")); - }, + } } } Ok(ReprC { repr_c: None }) } } - struct Derives { derives: Option<Vec<Ident>>, } |