[][src]Function envmnt::is_equal

pub fn is_equal<K: AsRef<OsStr>>(key: K, value: &str) -> bool

Returns true if the provided environment variable is defined and equals the provided value.

Arguments

  • key - The environment variable name
  • value - The value to check

Example

extern crate envmnt;

fn main() {
    envmnt::set("MY_ENV_VAR", "SOME VALUE");

    let same = envmnt::is_equal("MY_ENV_VAR", "SOME VALUE");
    assert!(same);
}