mirror of
https://github.com/jht5945/rust_util.git
synced 2025-12-29 00:20:04 +08:00
update
This commit is contained in:
@@ -2,8 +2,5 @@
|
||||
use std::env;
|
||||
|
||||
pub fn is_env_on(var: &str) -> bool {
|
||||
match env::var(var) {
|
||||
Err(_) => false,
|
||||
Ok(v) => (v == "TRUE" || v == "true" || v =="YES" || v == "yes" || v == "1"),
|
||||
}
|
||||
env::var(var).map(|v| v.to_lowercase()).map(|v| (v == "true" || v == "yes" || v == "1")).unwrap_or(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user