Provide more ergonomic env var checking

Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
This commit is contained in:
Luc Perkins 2024-05-16 15:04:04 -03:00 committed by GitHub
parent 06fb14658c
commit 1ee5b1eec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,5 +46,5 @@ impl Display for Environment {
}
fn env_var_is_true(e: &str) -> bool {
&env::var(e).unwrap_or(String::from("")) == "true"
std::env::var(e).is_ok_and(|v| v == "true")
}