fn push_state(&mut self, ty: &Type, label: Option<String>) -> GenConfig {
        let elem = if let Some(lab) = label {
            lab
        } else {
            match ty {
                Type::Var(_) => (),
                _ => {
                    self.depth -= 1;
                    self.size -= 1;
                }
            }
            path_name(ty)
        };
        let mut old_config = self.config.clone();
        self.path.push(elem);
        if let Some((config, recursive)) = self.tree.get::<GenConfig>(&self.path) {
            self.config = self.config.update(config, recursive);
        }
        // Current depth and size are stored in old_config for pop_state to restore states.
        old_config.depth = Some(self.depth);
        old_config.size = Some(self.size);
        self.depth = self.config.depth.take().unwrap_or(self.depth);
        self.size = self.config.size.take().unwrap_or(self.size);
        old_config
    }
// Update state and return the old config state. Label and var type are cost free.
Update state and return the old config state. Label and var type are cost free.
Update state and return the old config state . Label and var type are cost free .
fn push_state(&mut self, ty: &Type, label: Option<String>) -> GenConfig {
        let elem = if let Some(lab) = label {
            lab
        } else {
            match ty {
                Type::Var(_) => (),
                _ => {
                    self.depth -= 1;
                    self.size -= 1;
                }
            }
            path_name(ty)
        };
        let mut old_config = self.config.clone();
        self.path.push(elem);
        if let Some((config, recursive)) = self.tree.get::<GenConfig>(&self.path) {
            self.config = self.config.update(config, recursive);
        }
        // Current depth and size are stored in old_config for pop_state to restore states.
        old_config.depth = Some(self.depth);
        old_config.size = Some(self.size);
        self.depth = self.config.depth.take().unwrap_or(self.depth);
        self.size = self.config.size.take().unwrap_or(self.size);
        old_config
    }
fn push_state ( & mut self , ty : & Type , label : Option < String > ) -> GenConfig { let elem = if let Some ( lab ) = label { lab } else { match ty { Type :: Var ( _ ) => ( ) , _ => { self . depth -= 1 ; self . size -= 1 ; } } path_name ( ty ) } ; let mut old_config = self . config . clone ( ) ; self . path . push ( elem ) ; if let Some ( ( config , recursive ) ) = self . tree . get :: < GenConfig > ( & self . path ) { self . config = self . config . update ( config , recursive ) ; } // Current depth and size are stored in old_config for pop_state to restore states. old_config . depth = Some ( self . depth ) ; old_config . size = Some ( self . size ) ; self . depth = self . config . depth . take ( ) . unwrap_or ( self . depth ) ; self . size = self . config . size . take ( ) . unwrap_or ( self . size ) ; old_config }
Update state and return the old config state.
Update state and return the old config state .
&mut self
ty
&Type
label
Option<String>
&mut self
ty
&Type
label
Option<String>