mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-23 12:13:48 +01:00
Simplify a few "if" structures
This commit is contained in:
committed by
Pratyush Mishra
parent
53a51eb4dc
commit
b42d5f8d36
@@ -201,7 +201,7 @@ impl AllocatedBit {
|
||||
|
||||
impl PartialEq for AllocatedBit {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
!self.value.is_none() && !other.value.is_none() && self.value == other.value
|
||||
self.value.is_some() && other.value.is_some() && self.value == other.value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -312,7 +312,7 @@ impl<ConstraintF: Field> ToBytesGadget<ConstraintF> for UInt32 {
|
||||
|
||||
impl PartialEq for UInt32 {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
!self.value.is_none() && !other.value.is_none() && self.value == other.value
|
||||
self.value.is_some() && other.value.is_some() && self.value == other.value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ impl UInt8 {
|
||||
|
||||
impl PartialEq for UInt8 {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
!self.value.is_none() && !other.value.is_none() && self.value == other.value
|
||||
self.value.is_some() && other.value.is_some() && self.value == other.value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user