Finite state machines in rust; bendns fork to add types.
Diffstat (limited to 'README.md')
-rw-r--r--README.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/README.md b/README.md
index b8b75bc..6d9eb1b 100644
--- a/README.md
+++ b/README.md
@@ -78,12 +78,11 @@ This state machine can be used as follows:
```rust
// Initialize the state machine. The state is `Closed` now.
let mut machine: StateMachineWrapper<CircuitBreaker> = StateMachineWrapper::new();
-// Consume the `Successful` input. No state transition is performed. Output
-// is `None`.
-machine.consume_anyway(&CircuitBreakerInput::Successful);
+// Consume the `Successful` input. No state transition is performed.
+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_anyway(&CircuitBreakerInput::Unsuccesful);
+let output = machine.consume(&CircuitBreakerInput::Unsuccesful).unwrap();
// Check the output
if output == Some(CircuitBreakerOutput::SetupTimer) {
// Set up the timer...