diff --git a/src/curve.rs b/src/curve.rs index b2206d3..ff82477 100644 --- a/src/curve.rs +++ b/src/curve.rs @@ -470,13 +470,7 @@ pub trait IsIdentity { /// constructor. impl IsIdentity for T where T: CTEq + Identity { fn is_identity(&self) -> bool { - let identity: T = T::identity(); - - if self.ct_eq(&identity) == 1u8 { - return true; - } else { - return false; - } + self.ct_eq(&T::identity()) == 1u8 } } diff --git a/src/scalar.rs b/src/scalar.rs index f7808e3..5d6a5ec 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -72,13 +72,7 @@ impl PartialEq for Scalar { /// /// True if they are equal, and false otherwise. fn eq(&self, other: &Self) -> bool { - let equal: u8 = arrays_equal_ct(&self.0, &other.0); - - if equal == 1u8 { - return true; - } else { - return false; - } + arrays_equal_ct(&self.0, &other.0) == 1u8 } }