From 99c206a9b91723846f059f5ec7baeada0dba5ab0 Mon Sep 17 00:00:00 2001 From: Flora Hill Date: Mon, 8 Apr 2024 01:57:46 +0000 Subject: [PATCH] Change env check to be more readable --- tests/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/main.rs b/tests/main.rs index 7558ac5..f834b74 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -12,8 +12,8 @@ pub mod test { static CLIENT: Lazy = Lazy::new(|| { // Load .env file if DEVID and KEY are not set - if !std::env::vars().any(|(k, _)| k == "DEVID" || k == "KEY") { - dotenv().ok().expect("Failed to find .env"); + if std::env::var("DEVID").is_err() || std::env::var("KEY").is_err() { + dotenv().ok(); } Client::new(