From 1e5c7631b49507ebfe91bf95c74b8a768675686f Mon Sep 17 00:00:00 2001 From: Akseli Lukkarila Date: Fri, 15 Sep 2023 12:55:57 +0300 Subject: [PATCH] simplify option conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kalle Ahlström <71292737+kqlski@users.noreply.github.com> --- rust/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index ffcd0f6a..05906f3f 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -389,8 +389,5 @@ fn get_s3_data_keys(name: &str) -> [String; 3] { /// Return possible env variable value as Option fn get_env_variable(name: &str) -> Option { - match env::var(name) { - Ok(value) => Some(value), - Err(_) => None, - } + env::var(name).ok() }