Skip to content

Commit 15b8e95

Browse files
authored
async-signature: remove 'static bounds (#1430)
As discussed in #1375. These bounds don't add value: it requires notating them even when unnecessary, and when necessary they still need to be notated anyway.
1 parent bd53cc9 commit 15b8e95

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

async-signature/src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use signature::rand_core::CryptoRngCore;
2525
///
2626
/// This trait is an async equivalent of the [`signature::Signer`] trait.
2727
#[allow(async_fn_in_trait)]
28-
pub trait AsyncSigner<S: 'static> {
28+
pub trait AsyncSigner<S> {
2929
/// Attempt to sign the given message, returning a digital signature on
3030
/// success, or an error if something went wrong.
3131
///
@@ -36,7 +36,6 @@ pub trait AsyncSigner<S: 'static> {
3636

3737
impl<S, T> AsyncSigner<S> for T
3838
where
39-
S: 'static,
4039
T: signature::Signer<S>,
4140
{
4241
async fn sign_async(&self, msg: &[u8]) -> Result<S, Error> {
@@ -51,8 +50,7 @@ where
5150
#[allow(async_fn_in_trait)]
5251
pub trait AsyncDigestSigner<D, S>
5352
where
54-
D: Digest + 'static,
55-
S: 'static,
53+
D: Digest,
5654
{
5755
/// Attempt to sign the given prehashed message [`Digest`], returning a
5856
/// digital signature on success, or an error if something went wrong.
@@ -62,8 +60,7 @@ where
6260
#[cfg(feature = "digest")]
6361
impl<D, S, T> AsyncDigestSigner<D, S> for T
6462
where
65-
D: Digest + 'static,
66-
S: 'static,
63+
D: Digest,
6764
T: signature::DigestSigner<D, S>,
6865
{
6966
async fn sign_digest_async(&self, digest: D) -> Result<S, Error> {
@@ -97,7 +94,6 @@ pub trait AsyncRandomizedSigner<S> {
9794
#[cfg(feature = "rand_core")]
9895
impl<S, T> AsyncRandomizedSigner<S> for T
9996
where
100-
S: 'static,
10197
T: signature::RandomizedSigner<S>,
10298
{
10399
async fn try_sign_with_rng_async(

0 commit comments

Comments
 (0)