From 05d85618e3e6ac1606fc4c0ff0164d5db99049f1 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 1 Jan 2024 17:45:20 +0100 Subject: [PATCH] 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. --- tests/common/util.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/common/util.rs b/tests/common/util.rs index 6f4e76d42..5dac61f7e 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -55,9 +55,7 @@ const DEFAULT_ENV: [(&str, &str); 2] = [("LC_ALL", "C"), ("TZ", "UTC")]; /// Test if the program is running under CI pub fn is_ci() -> bool { - std::env::var("CI") - .unwrap_or_else(|_| String::from("false")) - .eq_ignore_ascii_case("true") + std::env::var("CI").is_ok_and(|s| s.eq_ignore_ascii_case("true")) } /// Read a test scenario fixture, returning its bytes