pub fn refresh_defaults(&self) {
        // Activate a "random" available jig.
        if self.current_jig.borrow().is_none() && !self.jigs.borrow().is_empty() {
            let new_jig_id = self.jigs.borrow().keys().next().unwrap().clone();
            self.activate(&new_jig_id);
        }

        // If there is no current scenario, select a random one.
        if self.current_scenario.borrow().is_none() && !self.scenarios.borrow().is_empty() {
            let new_scenario_id = self.scenarios.borrow().keys().next().unwrap().clone();
            self.select(&new_scenario_id);
        }
    }
/// If there are unselected defaults, activate them.
/// For example, if there is no current Jig, activate the first Jig we find.
/// Likewise, if there is no selected Scenario, select the first scenario we find.

If there are unselected defaults, activate them.
For example, if there is no current Jig, activate the first Jig we find.
Likewise, if there is no selected Scenario, select the first scenario we find.
If there are unselected defaults activate them . For example if there is no current Jig activate the first Jig we find . Likewise if there is no selected Scenario select the first scenario we find .
pub fn refresh_defaults(&self) {
        // Activate a "random" available jig.
        if self.current_jig.borrow().is_none() && !self.jigs.borrow().is_empty() {
            let new_jig_id = self.jigs.borrow().keys().next().unwrap().clone();
            self.activate(&new_jig_id);
        }
        // If there is no current scenario, select a random one.
        if self.current_scenario.borrow().is_none() && !self.scenarios.borrow().is_empty() {
            let new_scenario_id = self.scenarios.borrow().keys().next().unwrap().clone();
            self.select(&new_scenario_id);
        }
    }
pub fn refresh_defaults ( & self ) { // Activate a "random" available jig.
 if self . current_jig . borrow ( ) . is_none ( ) && ! self . jigs . borrow ( ) . is_empty ( ) { let new_jig_id = self . jigs . borrow ( ) . keys ( ) . next ( ) . unwrap ( ) . clone ( ) ; self . activate ( & new_jig_id ) ; } // If there is no current scenario, select a random one.
 if self . current_scenario . borrow ( ) . is_none ( ) && ! self . scenarios . borrow ( ) . is_empty ( ) { let new_scenario_id = self . scenarios . borrow ( ) . keys ( ) . next ( ) . unwrap ( ) . clone ( ) ; self . select ( & new_scenario_id ) ; } }
If there are unselected defaults, activate them.
If there are unselected defaults activate them .
&self
&self