fn make_rack(file_cfg: &Option<SpuConfigFile>) -> Result<Option<String>, IoError> {
        let mut rack = None;

        // 1) environment variable (optional field, ignore errors)
        if rack.is_none() {
            if let Ok(rack_str) = env::var(FLV_RACK) {
                rack = Some(rack_str);
            }
        }

        // 2) config file
        if rack.is_none() && file_cfg.is_some() {
            rack = file_cfg.as_ref().unwrap().rack();
        }

        // return result
        Ok(rack)
    }
/// Generate rack by combining all config elements. Returns error on failure.
Generate rack by combining all config elements. Returns error on failure.
Generate rack by combining all config elements . Returns error on failure .
fn make_rack(file_cfg: &Option<SpuConfigFile>) -> Result<Option<String>, IoError> {
        let mut rack = None;
        // 1) environment variable (optional field, ignore errors)
        if rack.is_none() {
            if let Ok(rack_str) = env::var(FLV_RACK) {
                rack = Some(rack_str);
            }
        }
        // 2) config file
        if rack.is_none() && file_cfg.is_some() {
            rack = file_cfg.as_ref().unwrap().rack();
        }
        // return result
        Ok(rack)
    }
fn make_rack ( file_cfg : & Option < SpuConfigFile > ) -> Result < Option < String > , IoError > { let mut rack = None ; // 1) environment variable (optional field, ignore errors) if rack . is_none ( ) { if let Ok ( rack_str ) = env :: var ( FLV_RACK ) { rack = Some ( rack_str ) ; } } // 2) config file if rack . is_none ( ) && file_cfg . is_some ( ) { rack = file_cfg . as_ref ( ) . unwrap ( ) . rack ( ) ; } // return result Ok ( rack ) }
Generate rack by combining all config elements.
Generate rack by combining all config elements .
file_cfg
&Option<SpuConfigFile>
file_cfg
&Option<SpuConfigFile>