mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-14 10:45:47 +00:00
Take self directly in into_* functions
This commit is contained in:
parent
fe93f2ff6b
commit
9016548698
@ -404,7 +404,7 @@ pub fn blake2s<E: Engine, CS: ConstraintSystem<E>>(
|
||||
)?;
|
||||
}
|
||||
|
||||
Ok(h.iter().flat_map(|b| b.into_bits()).collect())
|
||||
Ok(h.into_iter().flat_map(|b| b.into_bits()).collect())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -72,8 +72,10 @@ impl UInt32 {
|
||||
Ok(UInt32 { bits, value })
|
||||
}
|
||||
|
||||
pub fn into_bits_be(&self) -> Vec<Boolean> {
|
||||
self.bits.iter().rev().cloned().collect()
|
||||
pub fn into_bits_be(self) -> Vec<Boolean> {
|
||||
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<Boolean> {
|
||||
self.bits.clone()
|
||||
pub fn into_bits(self) -> Vec<Boolean> {
|
||||
self.bits
|
||||
}
|
||||
|
||||
/// Converts a little-endian byte order representation of bits into a
|
||||
|
@ -508,7 +508,7 @@ impl<E: JubjubEngine> MontgomeryPoint<E> {
|
||||
/// a point in the birationally equivalent twisted
|
||||
/// Edwards curve.
|
||||
pub fn into_edwards<CS>(
|
||||
&self,
|
||||
self,
|
||||
mut cs: CS,
|
||||
params: &E::Params,
|
||||
) -> Result<EdwardsPoint<E>, SynthesisError>
|
||||
|
Loading…
x
Reference in New Issue
Block a user