Finite state machines in rust; bendns fork to add types.
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/README.md b/README.md
index fa81331..97f2990 100644
--- a/README.md
+++ b/README.md
@@ -88,13 +88,13 @@ let mut machine: StateMachine<CircuitBreaker> = StateMachine::new();
let _ = machine.consume(&CircuitBreakerInput::Successful);
// Consume the `Unsuccesful` input. The machine is moved to the `Open`
// state. The output is `SetupTimer`.
-let output = machine.consume(&CircuitBreakerInput::Unsuccesful).unwrap();
+let output = machine.consume(&CircuitBreakerInput::Unsuccessful).unwrap();
// Check the output
-if output == Some(CircuitBreakerOutput::SetupTimer) {
+if let Some(CircuitBreakerOutput::SetupTimer) = output {
// Set up the timer...
}
// Check the state
-if machine.state() == &CircuitBreakerState::Open {
+if let CircuitBreakerState::Open = machine.state() {
// Do something...
}
```