Skip to content

Commit 1860322

Browse files
committed
Constrain Signer::Error
In practice, most errors need to satisfy: std::error::Error + Send + Sync + 'static and `Signer::Error` is no exception. By defining the bound on the trait here, some wild tricks involving associated type bounds can be removed from `link-crypto`. This lets us avoid a compiler bug in recent `rustc`s [0] without compromising errrrgonomics. [0]: rust-lang/rust#90691 Signed-off-by: Kim Altintop <[email protected]>
1 parent 7e8828d commit 1860322

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sign/ed25519.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl Debug for Signature {
107107

108108
#[async_trait]
109109
pub trait Signer {
110-
type Error;
110+
type Error: std::error::Error + Send + Sync + 'static;
111111

112112
/// Obtain the [`PublicKey`] used for signing
113113
fn public_key(&self) -> PublicKey;

0 commit comments

Comments
 (0)