From 2bfec09e66497f89fbb9bf29427bee076ee1f3d3 Mon Sep 17 00:00:00 2001 From: Bohdan Ohorodnii Date: Mon, 14 Oct 2024 13:35:08 +0300 Subject: [PATCH] refactor: use unwrap_or_else instead of match --- crates/blockifier/src/test_utils/cairo_compile.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/blockifier/src/test_utils/cairo_compile.rs b/crates/blockifier/src/test_utils/cairo_compile.rs index 094fa4239e..9ccd25d6bc 100644 --- a/crates/blockifier/src/test_utils/cairo_compile.rs +++ b/crates/blockifier/src/test_utils/cairo_compile.rs @@ -71,10 +71,10 @@ fn local_cairo1_compiler_repo_path() -> PathBuf { // Location of blockifier's Cargo.toml. let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); - Path::new(&manifest_dir).join(match std::env::var(CAIRO1_REPO_RELATIVE_PATH_OVERRIDE_ENV_VAR) { - Ok(cairo1_repo_relative_path) => cairo1_repo_relative_path, - Err(_) => DEFAULT_CAIRO1_REPO_RELATIVE_PATH.into(), - }) + Path::new(&manifest_dir).join( + env::var(CAIRO1_REPO_RELATIVE_PATH_OVERRIDE_ENV_VAR) + .unwrap_or_else(|_| DEFAULT_CAIRO1_REPO_RELATIVE_PATH.into()), + ) } /// Runs a command. If it has succeeded, it returns the command's output; otherwise, it panics with