fn make_spu_type() -> Result<SpuType, IoError> {
        // look-up environment variable
        if let Ok(spu_type) = env::var(FLV_SPU_TYPE) {
            // match to appropriate values
            match spu_type.as_str() {
                "Custom" => Ok(SpuType::Custom),
                "Managed" => Ok(SpuType::Managed),
                _ => Err(IoError::new(
                    ErrorKind::InvalidInput,
                    format!(
                        "spu-type: expected 'Managed' or 'Custom', found '{}'",
                        spu_type
                    ),
                )),
            }
        } else {
            // default to Custom, if environment variable is not present
            Ok(SpuType::Custom)
        }
    }
/// Generate spu-type base on the presence of the environment variable. Returns error on failure.
Generate spu-type base on the presence of the environment variable. Returns error on failure.
Generate spu - type base on the presence of the environment variable . Returns error on failure .
fn make_spu_type() -> Result<SpuType, IoError> {
        // look-up environment variable
        if let Ok(spu_type) = env::var(FLV_SPU_TYPE) {
            // match to appropriate values
            match spu_type.as_str() {
                "Custom" => Ok(SpuType::Custom),
                "Managed" => Ok(SpuType::Managed),
                _ => Err(IoError::new(
                    ErrorKind::InvalidInput,
                    format!(
                        "spu-type: expected 'Managed' or 'Custom', found '{}'",
                        spu_type
                    ),
                )),
            }
        } else {
            // default to Custom, if environment variable is not present
            Ok(SpuType::Custom)
        }
    }
fn make_spu_type ( ) -> Result < SpuType , IoError > { // look-up environment variable if let Ok ( spu_type ) = env :: var ( FLV_SPU_TYPE ) { // match to appropriate values match spu_type . as_str ( ) { " " => Ok ( SpuType :: Custom ) , " " => Ok ( SpuType :: Managed ) , _ => Err ( IoError :: new ( ErrorKind :: InvalidInput , format ! ( " " spu_type ) , ) ) , } } else { // default to Custom, if environment variable is not present Ok ( SpuType :: Custom ) } }
Generate spu-type base on the presence of the environment variable.
Generate spu - type base on the presence of the environment variable .