From a5f25c50589b21f38aa6cc446423934fefdfbfa0 Mon Sep 17 00:00:00 2001 From: Eirik Ogilvie-Wigley Date: Tue, 20 Aug 2019 22:07:24 -0600 Subject: [PATCH] cargo fix --edition-idioms for bellman --- bellman/src/groth16/tests/dummy_engine.rs | 4 +-- bellman/src/lib.rs | 30 ++++++++++------------- bellman/src/multiexp.rs | 4 +-- bellman/tests/mimc.rs | 8 +++--- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/bellman/src/groth16/tests/dummy_engine.rs b/bellman/src/groth16/tests/dummy_engine.rs index 4c5874d..4692078 100644 --- a/bellman/src/groth16/tests/dummy_engine.rs +++ b/bellman/src/groth16/tests/dummy_engine.rs @@ -16,7 +16,7 @@ const MODULUS_R: Wrapping = Wrapping(64513); pub struct Fr(Wrapping); impl fmt::Display for Fr { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { write!(f, "{}", (self.0).0) } } @@ -149,7 +149,7 @@ impl PartialOrd for FrRepr { } impl fmt::Display for FrRepr { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { write!(f, "{}", (self.0)[0]) } } diff --git a/bellman/src/lib.rs b/bellman/src/lib.rs index 96400c9..e8ebaae 100644 --- a/bellman/src/lib.rs +++ b/bellman/src/lib.rs @@ -1,18 +1,16 @@ -extern crate ff; -extern crate group; -#[cfg(feature = "pairing")] -extern crate pairing; -extern crate rand_core; -extern crate bit_vec; -extern crate blake2s_simd; -extern crate byteorder; -extern crate futures; + + + + + + + + #[cfg(feature = "multicore")] extern crate crossbeam; -#[cfg(feature = "multicore")] -extern crate futures_cpupool; + #[cfg(feature = "multicore")] extern crate num_cpus; @@ -23,11 +21,9 @@ extern crate hex_literal; #[cfg(test)] extern crate rand; -#[cfg(test)] -extern crate rand_xorshift; -#[cfg(test)] -extern crate sha2; + + pub mod domain; pub mod gadgets; @@ -230,7 +226,7 @@ impl Error for SynthesisError { } impl fmt::Display for SynthesisError { - fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { if let &SynthesisError::IoError(ref e) = self { write!(f, "I/O error: ")?; e.fmt(f) @@ -309,7 +305,7 @@ pub trait ConstraintSystem: Sized { /// This is a "namespaced" constraint system which borrows a constraint system (pushing /// a namespace context) and, when dropped, pops out of the namespace context. -pub struct Namespace<'a, E: ScalarEngine, CS: ConstraintSystem + 'a>(&'a mut CS, PhantomData); +pub struct Namespace<'a, E: ScalarEngine, CS: ConstraintSystem>(&'a mut CS, PhantomData); impl<'cs, E: ScalarEngine, CS: ConstraintSystem> ConstraintSystem for Namespace<'cs, E, CS> { type Root = CS::Root; diff --git a/bellman/src/multiexp.rs b/bellman/src/multiexp.rs index fabb978..b7729a8 100644 --- a/bellman/src/multiexp.rs +++ b/bellman/src/multiexp.rs @@ -153,7 +153,7 @@ fn multiexp_inner( mut skip: u32, c: u32, handle_trivial: bool, -) -> Box::Projective, Error = SynthesisError>> +) -> Box::Projective, Error = SynthesisError>> where for<'a> &'a Q: QueryDensity, D: Send + Sync + 'static + Clone + AsRef, @@ -256,7 +256,7 @@ pub fn multiexp( bases: S, density_map: D, exponents: Arc::Fr as PrimeField>::Repr>>, -) -> Box::Projective, Error = SynthesisError>> +) -> Box::Projective, Error = SynthesisError>> where for<'a> &'a Q: QueryDensity, D: Send + Sync + 'static + Clone + AsRef, diff --git a/bellman/tests/mimc.rs b/bellman/tests/mimc.rs index 94c0d63..7db26a5 100644 --- a/bellman/tests/mimc.rs +++ b/bellman/tests/mimc.rs @@ -1,7 +1,7 @@ -extern crate bellman; -extern crate ff; -extern crate pairing; -extern crate rand; + + + + // For randomness (during paramgen and proof generation) use rand::thread_rng;