diff options
author | Vincent Ambo <mail@tazj.in> | 2018-11-22T15·59+0100 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2018-11-22T15·59+0100 |
commit | 536793dbbb6eba468cf7bf98d1798a28d196cd6f (patch) | |
tree | cdbf2739ff9eb92286251cf655e9741c6df3c981 /finito-door/src/lib.rs | |
parent | 8c5ab60ac3a6af2d6bc8da904a55fbe84baf3c25 (diff) |
fix(door): Update trait impl with `State` type
The door does not actually require any state, so it just uses an empty tuple.
Diffstat (limited to 'finito-door/src/lib.rs')
-rw-r--r-- | finito-door/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/finito-door/src/lib.rs b/finito-door/src/lib.rs index e6a3099e9efa..2066ed81e42b 100644 --- a/finito-door/src/lib.rs +++ b/finito-door/src/lib.rs @@ -171,6 +171,7 @@ impl FSM for DoorState { // type is 'DoorAction'. type Event = DoorEvent; type Action = DoorAction; + type State = (); // For error handling, the door simply uses `failure` which provides a // generic, chainable error type. In real-world implementations you may want @@ -261,7 +262,7 @@ impl FSM for DoorState { // Additionally the `act` function can return new events. This is useful for // a sort of "callback-like" pattern (cause an action to fetch some data, // receive it as an event) but is not used in this example. - fn act(action: DoorAction) -> Result<Vec<DoorEvent>, failure::Error> { + fn act(action: DoorAction, _state: ()) -> Result<Vec<DoorEvent>, failure::Error> { match action { DoorAction::NotifyIRC(msg) => { use std::fs::OpenOptions; |