pub fn is_equal<K: AsRef<OsStr>>(key: K, value: &str) -> bool
Expand description
Returns true if the provided environment variable is defined and equals the provided value.
§Arguments
key
- The environment variable namevalue
- The value to check
§Example
fn main() {
envmnt::set("MY_ENV_VAR", "SOME VALUE");
let same = envmnt::is_equal("MY_ENV_VAR", "SOME VALUE");
assert!(same);
}