1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

test: use clearer expression for CI testing

`bool::is_ok_and()` is available in Rust 1.70.0 and above, which is compatible
with the current MSRV.
This commit is contained in:
Samuel Tardieu 2024-01-01 17:45:20 +01:00
parent 89fd26c9db
commit 05d85618e3

View file

@ -55,9 +55,7 @@ const DEFAULT_ENV: [(&str, &str); 2] = [("LC_ALL", "C"), ("TZ", "UTC")];
/// Test if the program is running under CI /// Test if the program is running under CI
pub fn is_ci() -> bool { pub fn is_ci() -> bool {
std::env::var("CI") std::env::var("CI").is_ok_and(|s| s.eq_ignore_ascii_case("true"))
.unwrap_or_else(|_| String::from("false"))
.eq_ignore_ascii_case("true")
} }
/// Read a test scenario fixture, returning its bytes /// Read a test scenario fixture, returning its bytes