diff --git a/signature/async/src/lib.rs b/signature/async/src/lib.rs index 8a1cd641..736bcdf4 100644 --- a/signature/async/src/lib.rs +++ b/signature/async/src/lib.rs @@ -18,12 +18,8 @@ use async_trait::async_trait; /// (e.g. client for a Cloud KMS or HSM), returning a digital signature. /// /// This trait is an async equivalent of the [`signature::Signer`] trait. -#[async_trait] -pub trait AsyncSigner -where - Self: Send + Sync, - S: Send + 'static, -{ +#[async_trait(?Send)] +pub trait AsyncSigner { /// Attempt to sign the given message, returning a digital signature on /// success, or an error if something went wrong. /// @@ -32,11 +28,11 @@ where async fn sign_async(&self, msg: &[u8]) -> Result; } -#[async_trait] +#[async_trait(?Send)] impl AsyncSigner for T where - S: Send + 'static, - T: signature::Signer + Send + Sync, + S: 'static, + T: signature::Signer, { async fn sign_async(&self, msg: &[u8]) -> Result { self.try_sign(msg) @@ -47,11 +43,10 @@ where /// /// This trait is an async equivalent of the [`signature::DigestSigner`] trait. #[cfg(feature = "digest")] -#[async_trait] +#[async_trait(?Send)] pub trait AsyncDigestSigner where - Self: Send + Sync, - D: Digest + Send + 'static, + D: Digest + 'static, S: 'static, { /// Attempt to sign the given prehashed message [`Digest`], returning a @@ -60,12 +55,12 @@ where } #[cfg(feature = "digest")] -#[async_trait] +#[async_trait(?Send)] impl AsyncDigestSigner for T where - D: Digest + Send + 'static, - S: Send + 'static, - T: signature::DigestSigner + Send + Sync, + D: Digest + 'static, + S: 'static, + T: signature::DigestSigner, { async fn sign_digest_async(&self, digest: D) -> Result { self.try_sign_digest(digest)