Skip to content

Commit

Permalink
cargo fix --edition-idioms for bellman
Browse files Browse the repository at this point in the history
  • Loading branch information
Eirik Ogilvie-Wigley committed Aug 21, 2019
1 parent dc2a280 commit cff2e2f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/groth16/tests/dummy_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const MODULUS_R: Wrapping<u32> = Wrapping(64513);
pub struct Fr(Wrapping<u32>);

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)
}
}
Expand Down Expand Up @@ -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])
}
}
Expand Down
30 changes: 13 additions & 17 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -309,7 +305,7 @@ pub trait ConstraintSystem<E: ScalarEngine>: 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<E> + 'a>(&'a mut CS, PhantomData<E>);
pub struct Namespace<'a, E: ScalarEngine, CS: ConstraintSystem<E>>(&'a mut CS, PhantomData<E>);

impl<'cs, E: ScalarEngine, CS: ConstraintSystem<E>> ConstraintSystem<E> for Namespace<'cs, E, CS> {
type Root = CS::Root;
Expand Down
4 changes: 2 additions & 2 deletions src/multiexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn multiexp_inner<Q, D, G, S>(
mut skip: u32,
c: u32,
handle_trivial: bool,
) -> Box<Future<Item = <G as CurveAffine>::Projective, Error = SynthesisError>>
) -> Box<dyn Future<Item = <G as CurveAffine>::Projective, Error = SynthesisError>>
where
for<'a> &'a Q: QueryDensity,
D: Send + Sync + 'static + Clone + AsRef<Q>,
Expand Down Expand Up @@ -256,7 +256,7 @@ pub fn multiexp<Q, D, G, S>(
bases: S,
density_map: D,
exponents: Arc<Vec<<<G::Engine as ScalarEngine>::Fr as PrimeField>::Repr>>,
) -> Box<Future<Item = <G as CurveAffine>::Projective, Error = SynthesisError>>
) -> Box<dyn Future<Item = <G as CurveAffine>::Projective, Error = SynthesisError>>
where
for<'a> &'a Q: QueryDensity,
D: Send + Sync + 'static + Clone + AsRef<Q>,
Expand Down
8 changes: 4 additions & 4 deletions tests/mimc.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit cff2e2f

Please sign in to comment.