diff --git a/src/circuit/gadgets/circom/mod.rs b/src/circuit/gadgets/circom/mod.rs index c83e990581..cecf133b1c 100644 --- a/src/circuit/gadgets/circom/mod.rs +++ b/src/circuit/gadgets/circom/mod.rs @@ -1,9 +1,6 @@ //! # Usage of circom coprocessors. //! //! See `examples/circom.rs` for a quick example of how to declare a circom coprocessor. - -pub mod keccak; - use crate::{ field::LurkField, lem::{pointers::Ptr, store::Store}, diff --git a/src/cli/circom.rs b/src/cli/circom.rs index bf3e305185..d28067ab71 100644 --- a/src/cli/circom.rs +++ b/src/cli/circom.rs @@ -82,7 +82,7 @@ pub(crate) fn create_circom_gadget(circom_folder: &Utf8PathBuf, reference: &str) // We expect a format / for the name. // TODO: should we switch to check regex: ^[a-zA-Z0-9]+([_-]?[a-zA-Z0-9]+)*\/[a-zA-Z0-9]+([_-]?[a-zA-Z0-9]+)*$ ? - let reference_split: Vec<&str> = reference.split("/").collect(); + let reference_split: Vec<&str> = reference.split('/').collect(); if reference_split.len() != 2 { bail!("Expected a reference of format \"/\", got \"{reference}\""); } diff --git a/src/coprocessor/circom/mod.rs b/src/coprocessor/circom/mod.rs index 6f48650954..e9d2b688db 100644 --- a/src/coprocessor/circom/mod.rs +++ b/src/coprocessor/circom/mod.rs @@ -50,11 +50,11 @@ pub mod non_wasm { let r1cs = circom_dir() .join(gadget.reference()) - .join(gadget.reference().split("/").collect::>()[1]) + .join(gadget.reference().split('/').collect::>()[1]) .with_extension("r1cs"); let wasm = circom_dir() .join(gadget.reference()) - .join(gadget.reference().split("/").collect::>()[1]) + .join(gadget.reference().split('/').collect::>()[1]) .with_extension("wasm"); if r1cs.exists() && wasm.exists() { @@ -69,7 +69,7 @@ pub mod non_wasm { fn get_remote_gadget>( gadget: &C, ) -> Result, CircomCoprocessorError> { - let name = gadget.reference().split("/").collect::>()[1]; + let name = gadget.reference().split('/').collect::>()[1]; // Check that we have a proper version for a remote release. If not, look if gadget repo exist // and return error accordingly. @@ -89,12 +89,12 @@ pub mod non_wasm { return Err(CircomCoprocessorError::GadgetNotFound { reference: ref_as_string.clone(), name: String::from(name), - prelude: prelude.into(), + prelude, }); } return Err(CircomCoprocessorError::MissingGadgetVersion { - prelude: prelude.into(), + prelude, reference: ref_as_string.clone(), }); } @@ -109,7 +109,7 @@ pub mod non_wasm { })?; } - let name = gadget.reference().split("/").collect::>()[1]; + let name = gadget.reference().split('/').collect::>()[1]; let r1cs = circom_dir() .join(gadget.reference()) .join(name) @@ -131,7 +131,7 @@ pub mod non_wasm { release: &str, extension: &str, ) -> Result<(), CircomCoprocessorError> { - let name = repository.split("/").collect::>()[1]; + let name = repository.split('/').collect::>()[1]; let asset_url = format!( "https://github.com/{repository}/releases/download/{release}/{name}.{extension}" ); @@ -150,13 +150,12 @@ pub mod non_wasm { trace: format!("{}", err), })?; - let mut out = fs::File::create(&path).map_err(|err| { - CircomCoprocessorError::AssetCreationFailure { + let mut out = + fs::File::create(path).map_err(|err| CircomCoprocessorError::AssetCreationFailure { prelude: error_prelude(), reference: String::from(repository), trace: format!("{}", err), - } - })?; + })?; let response_byte = &response @@ -190,7 +189,7 @@ pub mod non_wasm { Some(paths) => Ok(paths), None => Err(CircomCoprocessorError::GadgetNotFound { reference: String::from(gadget.reference()), - name: String::from(gadget.reference().split("/").collect::>()[1]), + name: String::from(gadget.reference().split('/').collect::>()[1]), prelude: error_prelude(), }), },