fn remove_redundant_regions(&mut self, region: &str) -> Result<()> {
        assert_eq!(self.state, ConfigState::File);
        assert!(self.has_region(region));
        let r = region.to_string();
        // filter out cluster and aliases as well so we don't have to special case verify
        self.clusters = self
            .clusters
            .clone()
            .into_iter()
            .filter(|(_, c)| c.regions.contains(&r))
            .collect();
        self.contextAliases = self
            .contextAliases
            .clone()
            .into_iter()
            .filter(|(_, v)| v == region)
            .collect();
        self.regions = self
            .regions
            .clone()
            .into_iter()
            .filter(|r| r.name == region)
            .collect();
        self.state = ConfigState::Base;
        Ok(())
    }
/// Filter a file based config for a known to exist region
Filter a file based config for a known to exist region
Filter a file based config for a known to exist region
fn remove_redundant_regions(&mut self, region: &str) -> Result<()> {
        assert_eq!(self.state, ConfigState::File);
        assert!(self.has_region(region));
        let r = region.to_string();
        // filter out cluster and aliases as well so we don't have to special case verify
        self.clusters = self
            .clusters
            .clone()
            .into_iter()
            .filter(|(_, c)| c.regions.contains(&r))
            .collect();
        self.contextAliases = self
            .contextAliases
            .clone()
            .into_iter()
            .filter(|(_, v)| v == region)
            .collect();
        self.regions = self
            .regions
            .clone()
            .into_iter()
            .filter(|r| r.name == region)
            .collect();
        self.state = ConfigState::Base;
        Ok(())
    }
fn remove_redundant_regions ( & mut self , region : & str ) -> Result < ( ) > { assert_eq ! ( self state ConfigState File ) ; assert ! ( self has_region ( region ) ) ; let r = region . to_string ( ) ; // filter out cluster and aliases as well so we don't have to special case verify self . clusters = self . clusters . clone ( ) . into_iter ( ) . filter ( | ( _ , c ) | c . regions . contains ( & r ) ) . collect ( ) ; self . contextAliases = self . contextAliases . clone ( ) . into_iter ( ) . filter ( | ( _ , v ) | v == region ) . collect ( ) ; self . regions = self . regions . clone ( ) . into_iter ( ) . filter ( | r | r . name == region ) . collect ( ) ; self . state = ConfigState :: Base ; Ok ( ( ) ) }
Filter a file based config for a known to exist region
Filter a file based config for a known to exist region
&mut self
region
&str
&mut self
region
&str