From 7d4e9162e6879a0325db23f636c22f072c302041 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Wed, 9 Jun 2021 13:20:35 -0700 Subject: [PATCH] elliptic-curve: derive `Copy` on `PublicKey` (#666) The new trait bounds on `AffineArithmetic` ensure that `AffinePoint` is always `Copy`. So the previously imposed trait bounds prevent `Copy` impls which should be available by default. --- elliptic-curve/src/public_key.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/elliptic-curve/src/public_key.rs b/elliptic-curve/src/public_key.rs index 85c6581c2..281dcf902 100644 --- a/elliptic-curve/src/public_key.rs +++ b/elliptic-curve/src/public_key.rs @@ -59,7 +59,7 @@ use alloc::string::{String, ToString}; /// When the `pem` feature of this crate (or a specific RustCrypto elliptic /// curve crate) is enabled, a [`FromStr`] impl is also available. #[cfg_attr(docsrs, doc(cfg(feature = "arithmetic")))] -#[derive(Clone, Debug)] +#[derive(Copy, Clone, Debug)] pub struct PublicKey where C: Curve + ProjectiveArithmetic, @@ -260,14 +260,6 @@ where } } -impl Copy for PublicKey -where - C: Curve + ProjectiveArithmetic, - - AffinePoint: Copy + Clone + Debug, -{ -} - impl Eq for PublicKey where C: Curve + ProjectiveArithmetic,