Skip to content

Commit

Permalink
elliptic-cure: add explicit Copy bounds on public key (#667)
Browse files Browse the repository at this point in the history
The derived `Copy` impl appears to be adding additional undesired trait
bounds.

This explicit impl ensures it's always available.
  • Loading branch information
tarcieri authored Jun 9, 2021
1 parent 7d4e916 commit 9831d28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion elliptic-curve/src/public_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(Copy, Clone, Debug)]
#[derive(Clone, Debug)]
pub struct PublicKey<C>
where
C: Curve + ProjectiveArithmetic,
Expand Down Expand Up @@ -180,6 +180,8 @@ where
}
}

impl<C> Copy for PublicKey<C> where C: Curve + ProjectiveArithmetic {}

impl<C> TryFrom<EncodedPoint<C>> for PublicKey<C>
where
C: Curve + ProjectiveArithmetic,
Expand Down

0 comments on commit 9831d28

Please sign in to comment.