vergen_lib

Function add_default_map_entry

Source
pub fn add_default_map_entry(
    key: VergenKey,
    map: &mut CargoRustcEnvMap,
    warnings: &mut CargoWarning,
)
Expand description

Add a VergenKey entry as a default string into the CargoRustcEnvMap. The value is either from an environment variable override or crate::constants::VERGEN_IDEMPOTENT_DEFAULT

ยงExample

with_var("VERGEN_BUILD_DATE", Some("my own date"), || {
    let mut map: CargoRustcEnvMap = BTreeMap::new();
    let mut warning: CargoWarning = vec![];
    add_default_map_entry(VergenKey::BuildDate, &mut map, &mut warning);
assert_eq!(1, map.len());
assert_eq!(1, warning.len());
});