fn clear_cache_and_save(
        &mut self,
        current_state: Option<&mut StatePtr>,
    ) -> bool {
        if self.cache.states.len() <= 2 {
            // Why <= 2? Well, the states list always has its first two
            // positions filled by marker states for STATE_UNKNOWN and
            // STATE_DEAD. These states aren't actually used, but exist to
            // make sure no other state lives in those locations. Therefore,
            // a state vec with length <= 2 is actually "empty."
            return true;
        }
        match current_state {
            None => self.clear_cache(),
            Some(si) => {
                let cur = self.copy_state(*si);
                if !self.clear_cache() {
                    return false;
                }
                *si = self.restore_state(cur);
                true
            }
        }
    }
/// Clears the cache, but saves and restores current_state if it is not
/// none.
///
/// The current state must be provided here in case its location in the
/// cache changes.
///
/// This returns false if the cache is not cleared and the DFA should
/// give up.
Clears the cache, but saves and restores current_state if it is not
none.

The current state must be provided here in case its location in the
cache changes.

This returns false if the cache is not cleared and the DFA should
give up.
Clears the cache but saves and restores current_state if it is not none . The current state must be provided here in case its location in the cache changes . This returns false if the cache is not cleared and the DFA should give up .
fn clear_cache_and_save(
        &mut self,
        current_state: Option<&mut StatePtr>,
    ) -> bool {
        if self.cache.states.len() <= 2 {
            // Why <= 2? Well, the states list always has its first two
            // positions filled by marker states for STATE_UNKNOWN and
            // STATE_DEAD. These states aren't actually used, but exist to
            // make sure no other state lives in those locations. Therefore,
            // a state vec with length <= 2 is actually "empty."
            return true;
        }
        match current_state {
            None => self.clear_cache(),
            Some(si) => {
                let cur = self.copy_state(*si);
                if !self.clear_cache() {
                    return false;
                }
                *si = self.restore_state(cur);
                true
            }
        }
    }
fn clear_cache_and_save ( & mut self , current_state : Option < & mut StatePtr > , ) -> bool { if self . cache . states . len ( ) <= 2 { // Why <= 2? Well, the states list always has its first two // positions filled by marker states for STATE_UNKNOWN and // STATE_DEAD. These states aren't actually used, but exist to // make sure no other state lives in those locations. Therefore, // a state vec with length <= 2 is actually "empty." return true ; } match current_state { None => self . clear_cache ( ) , Some ( si ) => { let cur = self . copy_state ( * si ) ; if ! self . clear_cache ( ) { return false ; } * si = self . restore_state ( cur ) ; true } } }
Clears the cache, but saves and restores current_state if it is not
none.
Clears the cache but saves and restores current_state if it is not none .
&mut self
current_state
Option<&mut StatePtr>
&mut self
current_state
Option<&mut StatePtr>