Skip to content

Commit

Permalink
refactor: use unwrap_or_else instead of match
Browse files Browse the repository at this point in the history
  • Loading branch information
varex83 authored and rodrigo-pino committed Oct 29, 2024
1 parent e320345 commit cc00aea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/blockifier/src/test_utils/cairo_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc00aea

Please sign in to comment.