A simple library to parse human entered booleans, especially those from environment variables.
Currently the following strings are supported: - 1/0 - yes/no/y/n - true/false/t/f - on/off
rust
use humanbool::parse;
assert!(parse("y") == Ok(true));
```rust use humanbool::*; asserteq!(env("ENABLEKITTENS", "f"), Ok(false)); std::env::setvar("ENABLEKITTENS", "1"); assert!(env("ENABLE_KITTENS", "f") == Ok(true));
assert!(env("ENABLE_TURBO", "") == Err(Error::Empty)); ```