pub fn next(&mut self, transition: &T) {
        match self.transitions.get(transition) {
            Some(state_pairs) => match state_pairs.get(&self.current) {
                Some(destination) => self.current = destination.clone(),
                None => {
                    if self.dead_states.get(&self.current).is_some() {
                        return;
                    }
                    if self.goal_states.get(&self.current).is_some() {
                        return;
                    }
                    panic!("DFA::next(): There is no path defined from state ({:?}) on transition ({:?})", self.current, transition);
                }
            },
            None => panic!(
                "DFA::next(): Attempted to move with unknown transition ({:?})",
                transition
            ),
        }
    }
/// Moves the current state to the next state given some transition.
///
/// * Panics if the transition is not part of the alphabet.  
/// * Panics if the transition has no defined destination from the current state.
Moves the current state to the next state given some transition.
Panics if the transition is not part of the alphabet.
Panics if the transition has no defined destination from the current state.
Moves the current state to the next state given some transition . Panics if the transition is not part of the alphabet . Panics if the transition has no defined destination from the current state .
pub fn next(&mut self, transition: &T) {
        match self.transitions.get(transition) {
            Some(state_pairs) => match state_pairs.get(&self.current) {
                Some(destination) => self.current = destination.clone(),
                None => {
                    if self.dead_states.get(&self.current).is_some() {
                        return;
                    }
                    if self.goal_states.get(&self.current).is_some() {
                        return;
                    }
                    panic!("DFA::next(): There is no path defined from state ({:?}) on transition ({:?})", self.current, transition);
                }
            },
            None => panic!(
                "DFA::next(): Attempted to move with unknown transition ({:?})",
                transition
            ),
        }
    }
pub fn next ( & mut self , transition : & T ) { match self . transitions . get ( transition ) { Some ( state_pairs ) => match state_pairs . get ( & self . current ) { Some ( destination ) => self . current = destination . clone ( ) , None => { if self . dead_states . get ( & self . current ) . is_some ( ) { return ; } if self . goal_states . get ( & self . current ) . is_some ( ) { return ; } panic ! ( " " self current transition ) ; } } , None => panic ! ( " " transition ) , } }
Moves the current state to the next state given some transition.
Moves the current state to the next state given some transition .
&mut self
transition
&T
&mut self
transition
&T