Skip to content

Commit

Permalink
Rename into_ -> to_ where &self is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Aug 23, 2019
1 parent 08664b1 commit 614d784
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gadgets/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<E: Engine> AllocatedNum<E> {
/// order, requiring that the representation
/// strictly exists "in the field" (i.e., a
/// congruency is not allowed.)
pub fn into_bits_le_strict<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
pub fn to_bits_le_strict<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
where
CS: ConstraintSystem<E>,
{
Expand Down Expand Up @@ -189,7 +189,7 @@ impl<E: Engine> AllocatedNum<E> {
/// Convert the allocated number into its little-endian representation.
/// Note that this does not strongly enforce that the commitment is
/// "in the field."
pub fn into_bits_le<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
pub fn to_bits_le<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
where
CS: ConstraintSystem<E>,
{
Expand Down Expand Up @@ -522,7 +522,7 @@ mod test {
let mut cs = TestConstraintSystem::<Bls12>::new();

let n = AllocatedNum::alloc(&mut cs, || Ok(negone)).unwrap();
n.into_bits_le_strict(&mut cs).unwrap();
n.to_bits_le_strict(&mut cs).unwrap();

assert!(cs.is_satisfied());

Expand Down Expand Up @@ -550,9 +550,9 @@ mod test {
let n = AllocatedNum::alloc(&mut cs, || Ok(r)).unwrap();

let bits = if i % 2 == 0 {
n.into_bits_le(&mut cs).unwrap()
n.to_bits_le(&mut cs).unwrap()
} else {
n.into_bits_le_strict(&mut cs).unwrap()
n.to_bits_le_strict(&mut cs).unwrap()
};

assert!(cs.is_satisfied());
Expand Down

0 comments on commit 614d784

Please sign in to comment.