Finite state machines in rust; bendns fork to add types.
| -rw-r--r-- | rust_fsm/src/machine.rs | 2 | ||||
| -rw-r--r-- | rust_fsm_dsl/src/lib.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/rust_fsm/src/machine.rs b/rust_fsm/src/machine.rs index a38f7eb..c5f3a32 100644 --- a/rust_fsm/src/machine.rs +++ b/rust_fsm/src/machine.rs @@ -6,7 +6,7 @@ pub trait StateMachine { /// The input alphabet. type Input; /// The set of possible states. - type State; + type State: Copy; /// The output alphabet. type Output; /// The initial state of the machine. diff --git a/rust_fsm_dsl/src/lib.rs b/rust_fsm_dsl/src/lib.rs index 479e119..a16fb1b 100644 --- a/rust_fsm_dsl/src/lib.rs +++ b/rust_fsm_dsl/src/lib.rs @@ -142,7 +142,7 @@ pub fn state_machine(tokens: TokenStream) -> TokenStream { let output = quote! { struct #struct_name; - #[derive(Debug, PartialEq)] + #[derive(Clone, Copy, Debug, PartialEq)] enum #states_enum_name { #(#states),* } |