Finite state machines in rust; bendns fork to add types.
Merge pull request #13 from MicaiahReid/add-sm-derivations
chore: add Debug/Clone derivations to StateMachine
Yevhenii Babichenko 2024-05-12
parent e0078b2 · parent ebbe818 · commit ba43061
-rw-r--r--CHANGELOG.md2
-rw-r--r--rust-fsm/src/lib.rs1
2 files changed, 3 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2654edd..1d9699f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ adheres to [Semantic Versioning][semver].
## [Unreleased]
### Changed
* Update documentation.
+### Added
+* Derive `Debug` and `Clone` for `StateMachine` struct
## [0.6.1] - 2022-12-24
### Changed
diff --git a/rust-fsm/src/lib.rs b/rust-fsm/src/lib.rs
index 84c82cc..34b59cf 100644
--- a/rust-fsm/src/lib.rs
+++ b/rust-fsm/src/lib.rs
@@ -159,6 +159,7 @@ pub trait StateMachineImpl {
/// A convenience wrapper around the `StateMachine` trait that encapsulates the
/// state and transition and output function calls.
+#[derive(Debug, Clone)]
pub struct StateMachine<T: StateMachineImpl> {
state: T::State,
}