From 892f98022f855a743947ee898254fd316571ecfd Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 31 Mar 2026 13:33:20 -0400 Subject: [PATCH] Fix workspace clippy issues in fabro-test --- lib/crates/fabro-test/src/lib.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/crates/fabro-test/src/lib.rs b/lib/crates/fabro-test/src/lib.rs index 88a226b77..7656f253d 100644 --- a/lib/crates/fabro-test/src/lib.rs +++ b/lib/crates/fabro-test/src/lib.rs @@ -46,16 +46,17 @@ impl TestMode { /// Read an env var required by an E2E test, with mode-aware skip/strict behavior. #[must_use] +#[allow(clippy::print_stderr)] pub fn require_env(name: &str) -> Option { - match std::env::var(name) { - Ok(value) => Some(value), - Err(_) => { - if TestMode::from_env() == TestMode::Strict { - panic!("{name} not set (FABRO_TEST_MODE=strict)"); - } - eprintln!("skipping: {name} not set"); - None - } + if let Ok(value) = std::env::var(name) { + Some(value) + } else { + assert!( + TestMode::from_env() != TestMode::Strict, + "{name} not set (FABRO_TEST_MODE=strict)" + ); + eprintln!("skipping: {name} not set"); + None } }