diff --git a/generic-ec-curves/src/rust_crypto/mod.rs b/generic-ec-curves/src/rust_crypto/mod.rs index cceb689..040e262 100644 --- a/generic-ec-curves/src/rust_crypto/mod.rs +++ b/generic-ec-curves/src/rust_crypto/mod.rs @@ -84,7 +84,7 @@ impl fmt::Debug for RustCryptoCurve { impl Clone for RustCryptoCurve { fn clone(&self) -> Self { - Self { _ph: PhantomData } + *self } } diff --git a/generic-ec-curves/src/rust_crypto/point.rs b/generic-ec-curves/src/rust_crypto/point.rs index 5e4b8cc..377ec09 100644 --- a/generic-ec-curves/src/rust_crypto/point.rs +++ b/generic-ec-curves/src/rust_crypto/point.rs @@ -150,7 +150,7 @@ where E: CurveArithmetic, { fn clone(&self) -> Self { - Self(self.0) + *self } } diff --git a/generic-ec-curves/src/rust_crypto/scalar.rs b/generic-ec-curves/src/rust_crypto/scalar.rs index 1dbb910..fa11118 100644 --- a/generic-ec-curves/src/rust_crypto/scalar.rs +++ b/generic-ec-curves/src/rust_crypto/scalar.rs @@ -106,7 +106,7 @@ impl Default for RustCryptoScalar { impl Clone for RustCryptoScalar { fn clone(&self) -> Self { - Self(self.0) + *self } } diff --git a/generic-ec-zkp/src/polynomial.rs b/generic-ec-zkp/src/polynomial.rs index 84326ff..ef879c7 100644 --- a/generic-ec-zkp/src/polynomial.rs +++ b/generic-ec-zkp/src/polynomial.rs @@ -243,8 +243,8 @@ mod requires_alloc { { fn sum>>(mut iter: I) -> Self { let Some(mut sum) = iter.next().cloned() else { - return Self{ coefs: vec![] }; - }; + return Self { coefs: vec![] }; + }; for polynomial in iter { sum += polynomial; } @@ -258,8 +258,8 @@ mod requires_alloc { { fn sum>>(mut iter: I) -> Self { let Some(mut sum) = iter.next() else { - return Self{ coefs: vec![] }; - }; + return Self { coefs: vec![] }; + }; for polynomial in iter { sum += &polynomial }