Skip to content

Commit

Permalink
Clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
porcuquine committed Mar 18, 2019
1 parent 00b8cfe commit 7e24915
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions storage-proofs/src/circuit/apex_commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait ApexCommitment<E: JubjubEngine> {
);
let mut preimage_boolean = Vec::new();

for (i, comm) in (&allocated_nums).into_iter().enumerate() {
for (i, comm) in (&allocated_nums).iter().enumerate() {
preimage_boolean
.extend(comm.into_bits_le(cs.namespace(|| format!("preimage-bits-{}", i)))?);
// sad padding is sad
Expand Down Expand Up @@ -102,7 +102,8 @@ impl<E: JubjubEngine> ApexCommitment<E> for BinaryApexCommitment<E> {
let cs = &mut cs.namespace(|| "binary_commitment_inclusion");
let num_at_path = self.at_path(cs, path)?;

Ok(constraint::equal(cs, annotation, num, &num_at_path))
constraint::equal(cs, annotation, num, &num_at_path);
Ok(())
}
}

Expand Down Expand Up @@ -187,12 +188,8 @@ impl<E: JubjubEngine> ApexCommitment<E> for FlatApexCommitment<E> {
if path.is_empty() {
assert_eq!(size, 1);

Ok(constraint::equal(
cs,
annotation,
num,
&self.allocated_nums[0],
))
constraint::equal(cs, annotation, num, &self.allocated_nums[0]);
Ok(())
} else {
let reduced_size = size / 2; // Must divide evenly because size must be power of 2.
let mut new_allocated = Vec::with_capacity(reduced_size);
Expand Down

0 comments on commit 7e24915

Please sign in to comment.