From 768dd39b6987be78e45556d56755097bfe77934f Mon Sep 17 00:00:00 2001 From: vimwitch Date: Sat, 6 Jul 2024 21:29:19 -0700 Subject: [PATCH] refactor: env conditional --- build.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 10046a7..0010e49 100644 --- a/build.rs +++ b/build.rs @@ -5,11 +5,9 @@ include!("./src/transpile.rs"); // We only want to link our test witness functions if we're compiling // for the tests in rust-witness. Cargo/rust doesn't seem to offer -// a solution so we use a simple env variable in the test command +// a solution so we use a simple env variable set using .cargo fn main() { - let link_test_witness = - std::env::var("RUST_WITNESS_LINK_TEST_WITNESS").unwrap_or("".to_string()); - if link_test_witness != "" { + if let Ok(_) = std::env::var("RUST_WITNESS_LINK_TEST_WITNESS") { transpile_wasm(String::from("./tests")); } }