mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-10 16:01:28 +01:00
Use built-in iteration functions more
This commit is contained in:
committed by
Pratyush Mishra
parent
c42c7dd98a
commit
53a51eb4dc
@@ -586,7 +586,7 @@ impl Boolean {
|
||||
// This is part of a run of ones.
|
||||
current_run.push(a.clone());
|
||||
} else {
|
||||
if current_run.len() > 0 {
|
||||
if !current_run.is_empty() {
|
||||
// This is the start of a run of zeros, but we need
|
||||
// to k-ary AND against `last_run` first.
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ mod test {
|
||||
assert_eq!(a_inv.get_value().unwrap(), a_native.inverse().unwrap());
|
||||
// a * a * a = a^3
|
||||
let bits = BitIterator::new([0x3])
|
||||
.map(|bit| Boolean::constant(bit))
|
||||
.map(Boolean::constant)
|
||||
.collect::<Vec<_>>();
|
||||
assert_eq!(
|
||||
a_native * &(a_native * &a_native),
|
||||
|
||||
@@ -71,9 +71,6 @@ pub trait Assignment<T> {
|
||||
|
||||
impl<T> Assignment<T> for Option<T> {
|
||||
fn get(self) -> Result<T, r1cs_core::SynthesisError> {
|
||||
match self {
|
||||
Some(v) => Ok(v),
|
||||
None => Err(r1cs_core::SynthesisError::AssignmentMissing),
|
||||
}
|
||||
self.ok_or_else(|| { r1cs_core::SynthesisError::AssignmentMissing })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user