From 551f05235ffae838088ff2d333ab61731e2c4012 Mon Sep 17 00:00:00 2001 From: tchataigner Date: Tue, 12 Mar 2024 17:35:36 +0100 Subject: [PATCH] Update src/coprocessor/circom/mod.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Garillot <4142+huitseeker@users.noreply.github.com> --- src/coprocessor/circom/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/coprocessor/circom/mod.rs b/src/coprocessor/circom/mod.rs index cff051c22..58bae9222 100644 --- a/src/coprocessor/circom/mod.rs +++ b/src/coprocessor/circom/mod.rs @@ -172,14 +172,12 @@ pub mod non_wasm { ) -> Result<(Utf8PathBuf, Utf8PathBuf), CircomCoprocessorError> { match get_local_gadget(gadget)? { Some(paths) => Ok(paths), - None => match get_remote_gadget(gadget)? { - Some(paths) => Ok(paths), - None => Err(CircomCoprocessorError::GadgetNotFound { + None => get_remote_gadget(gadget)?.ok_or_else(|| CircomCoprocessorError::GadgetNotFound { reference: gadget.reference().clone(), name: String::from(gadget.reference().name()), prelude: error_prelude(), - }), - }, + }) + } } }