diff --git a/Cargo.toml b/Cargo.toml index 7e8d0b0..0adc7ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_util" -version = "0.6.49" +version = "0.6.50" authors = ["Hatter Jiang "] edition = "2018" description = "Hatter's Rust Util" diff --git a/src/util_env.rs b/src/util_env.rs index c90ec36..4809d70 100644 --- a/src/util_env.rs +++ b/src/util_env.rs @@ -1,11 +1,11 @@ use std::env; pub fn is_env_on(var: &str) -> bool { - env::var(var).ok().map(|val| is_on(&val)).unwrap_or(false) + env_var(var).map(|val| is_on(&val)).unwrap_or(false) } pub fn is_env_off(var: &str) -> bool { - env::var(var).ok().map(|val| is_off(&val)).unwrap_or(false) + env_var(var).map(|val| is_off(&val)).unwrap_or(false) } pub fn is_on(val: &str) -> bool {