/// Cleans up the configuration, enforcing all internal invariants.
// TODO replace with typestates / type safety wherever possible, by adjusting the loadstone
// front app to match.
Cleans up the configuration, enforcing all internal invariants.
TODO replace with typestates / type safety wherever possible, by adjusting the loadstone
front app to match.
Cleans up the configuration enforcing all internal invariants . TODO replace with typestates / type safety wherever possible by adjusting the loadstone front app to match .
pub fn cleanup(&mut self) {
        if !features::Serial::supported(&self.port) {
            self.feature_configuration.serial = Serial::Disabled;
        }
        if !features::BootMetrics::timing_supported(&self.port) {
            if let BootMetrics::Enabled{timing} = &mut self.feature_configuration.boot_metrics {
                *timing = false
            }
        }
        if !external_flash(&self.port).any(|f| Some(f) == self.memory_configuration.external_flash)
        {
            self.memory_configuration.external_flash = None;
        }
        if self.memory_configuration.external_flash.is_none() {
            self.memory_configuration.external_memory_map.banks.clear();
        }
    }
pub fn cleanup ( & mut self ) { if ! features :: Serial :: supported ( & self . port ) { self . feature_configuration . serial = Serial :: Disabled ; } if ! features :: BootMetrics :: timing_supported ( & self . port ) { if let BootMetrics :: Enabled { timing } = & mut self . feature_configuration . boot_metrics { * timing = false } } if ! external_flash ( & self . port ) . any ( | f | Some ( f ) == self . memory_configuration . external_flash ) { self . memory_configuration . external_flash = None ; } if self . memory_configuration . external_flash . is_none ( ) { self . memory_configuration . external_memory_map . banks . clear ( ) ; } }
Cleans up the configuration, enforcing all internal invariants.
Cleans up the configuration enforcing all internal invariants .
&mut self