pub fn from_location_specified_by_env_var(bin_name: &str, features: &[&str]) -> Option<Wasm> {
        let var_name = Wasm::env_var_name(bin_name, features);
        match env::var(&var_name) {
            Ok(path) => {
                eprintln!("Using pre-built binary for {}", bin_name);
                Some(Wasm::from_file(path))
            }
            Err(env::VarError::NotPresent) => {
                if env::var("CI").is_ok() {
                    panic!(
                        "Running on CI and expected canister env var {0}\n\
                         Please add {1} to the following locations:\n\
                        \tgitlab-ci/tools/cargo-build-canisters\n\
                        \tgitlab-ci/src/canisters/wasm-build-functions.sh",
                        var_name, bin_name
                    )
                }
                None
            }
            Err(e) => panic!("When trying to access var {}, got error {}.", var_name, e),
        }
    }
/// If an environment variable with a specific name derived from the binary
/// name exists, then assumes it is the location of a wasm file and
/// reads it.
If an environment variable with a specific name derived from the binary
name exists, then assumes it is the location of a wasm file and
reads it.
If an environment variable with a specific name derived from the binary name exists then assumes it is the location of a wasm file and reads it .
pub fn from_location_specified_by_env_var(bin_name: &str, features: &[&str]) -> Option<Wasm> {
        let var_name = Wasm::env_var_name(bin_name, features);
        match env::var(&var_name) {
            Ok(path) => {
                eprintln!("Using pre-built binary for {}", bin_name);
                Some(Wasm::from_file(path))
            }
            Err(env::VarError::NotPresent) => {
                if env::var("CI").is_ok() {
                    panic!(
                        "Running on CI and expected canister env var {0}\n\
                         Please add {1} to the following locations:\n\
                        \tgitlab-ci/tools/cargo-build-canisters\n\
                        \tgitlab-ci/src/canisters/wasm-build-functions.sh",
                        var_name, bin_name
                    )
                }
                None
            }
            Err(e) => panic!("When trying to access var {}, got error {}.", var_name, e),
        }
    }
pub fn from_location_specified_by_env_var ( bin_name : & str , features : & [ & str ] ) -> Option < Wasm > { let var_name = Wasm :: env_var_name ( bin_name , features ) ; match env :: var ( & var_name ) { Ok ( path ) => { eprintln ! ( " " bin_name ) ; Some ( Wasm :: from_file ( path ) ) } Err ( env :: VarError :: NotPresent ) => { if env :: var ( " " ) . is_ok ( ) { panic ! ( " \n \
 \n \
 \t \n \
 \t " var_name bin_name ) } None } Err ( e ) => panic ! ( " " var_name e ) , } }
If an environment variable with a specific name derived from the binary
name exists, then assumes it is the location of a wasm file and
reads it.
If an environment variable with a specific name derived from the binary name exists then assumes it is the location of a wasm file and reads it .
bin_name
&str
features
&[&str]
bin_name
&str
features
&[&str]