mirror of
https://github.com/jht5945/rust_util.git
synced 2026-03-12 10:10:04 +08:00
Compare commits
2 Commits
d218e1edd5
...
d75c331fa0
| Author | SHA1 | Date | |
|---|---|---|---|
| d75c331fa0 | |||
| 34df5b66a2 |
@@ -2,9 +2,7 @@
|
|||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
extern crate term;
|
extern crate term;
|
||||||
|
|
||||||
use std::{
|
use std::io::{ Error, ErrorKind, };
|
||||||
io::{Error, ErrorKind},
|
|
||||||
};
|
|
||||||
|
|
||||||
pub mod util_io;
|
pub mod util_io;
|
||||||
pub mod util_os;
|
pub mod util_os;
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
pub fn is_env_on(var: &str) -> bool {
|
pub fn is_env_on(var: &str) -> bool {
|
||||||
env::var(var).map(|v| v.to_lowercase()).map(|v| (v == "true" || v == "yes" || v == "1")).unwrap_or(false)
|
env::var(var).map(|v| v.to_lowercase()).map(|v| vec!["true", "yes", "1"].iter().any(|x| x == &v)).unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user