diff --git a/bellman/src/gadgets/blake2s.rs b/bellman/src/gadgets/blake2s.rs index beefe09..672f139 100644 --- a/bellman/src/gadgets/blake2s.rs +++ b/bellman/src/gadgets/blake2s.rs @@ -404,7 +404,7 @@ pub fn blake2s>( )?; } - Ok(h.iter().flat_map(|b| b.into_bits()).collect()) + Ok(h.into_iter().flat_map(|b| b.into_bits()).collect()) } #[cfg(test)] diff --git a/bellman/src/gadgets/uint32.rs b/bellman/src/gadgets/uint32.rs index 3467400..5a93e75 100644 --- a/bellman/src/gadgets/uint32.rs +++ b/bellman/src/gadgets/uint32.rs @@ -72,8 +72,10 @@ impl UInt32 { Ok(UInt32 { bits, value }) } - pub fn into_bits_be(&self) -> Vec { - self.bits.iter().rev().cloned().collect() + pub fn into_bits_be(self) -> Vec { + let mut ret = self.bits; + ret.reverse(); + ret } pub fn from_bits_be(bits: &[Boolean]) -> Self { @@ -101,8 +103,8 @@ impl UInt32 { } /// Turns this `UInt32` into its little-endian byte order representation. - pub fn into_bits(&self) -> Vec { - self.bits.clone() + pub fn into_bits(self) -> Vec { + self.bits } /// Converts a little-endian byte order representation of bits into a diff --git a/zcash_proofs/src/circuit/ecc.rs b/zcash_proofs/src/circuit/ecc.rs index ef5bedf..fa4913a 100644 --- a/zcash_proofs/src/circuit/ecc.rs +++ b/zcash_proofs/src/circuit/ecc.rs @@ -508,7 +508,7 @@ impl MontgomeryPoint { /// a point in the birationally equivalent twisted /// Edwards curve. pub fn into_edwards( - &self, + self, mut cs: CS, params: &E::Params, ) -> Result, SynthesisError>