Function humanbool::env [−][src]
pub fn env(k: &str, default: &str) -> Result<bool, Error>
Parse a setting from the environment.
use humanbool::*; assert_eq!(env("ENABLE_KITTENS", "f"), Ok(false)); std::env::set_var("ENABLE_KITTENS", "1"); assert!(env("ENABLE_KITTENS", "f") == Ok(true)); assert!(env("ENABLE_TURBO", "") == Err(Error::Empty));