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(), - }), - }, + }) + } } }