Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: reduce repeated code in state machine
This replaces repeated boilerplate code around handling taking/putting the state with a wrapper type. This wrapper type moves the state machine itself into a closure, allowing nice things like using ? to return errors and other early returns. It also makes simple an "Errored" state for the state machine so that calling the state machine after it's already returned an error is no longer a panic. Signed-off-by: Nick Stevens <[email protected]>
- Loading branch information