Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanCavers committed Oct 1, 2024
1 parent 6ed117c commit 46e5198
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/state_machine/src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ impl StateMachine {

pub fn handle_transition(&mut self, to_state: &State) {
let to_from_state = SourceAndTarget {
source: self.current_state.clone(),
target: to_state.clone(),
source: self.current_state,
target: *to_state,
};
match self.transition_map.get(&to_from_state) {
Some(&new_state) => self.current_state = new_state,
None => (),
if let Some(&new_state) = self.transition_map.get(&to_from_state) {
self.current_state = new_state;
}
}

Expand Down

0 comments on commit 46e5198

Please sign in to comment.