diff --git a/signature/src/error.rs b/signature/src/error.rs index 78be99926..c45643157 100644 --- a/signature/src/error.rs +++ b/signature/src/error.rs @@ -5,12 +5,6 @@ use core::fmt::{self, Display}; #[cfg(feature = "std")] use std::boxed::Box; -/// Box containing a thread-safe + `'static` error suitable for use as a -/// as a [`std::error::Error::source`] -#[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] -pub type BoxError = Box; - /// Signature errors. /// /// This type is deliberately opaque as to avoid sidechannel leakage which @@ -26,7 +20,7 @@ pub type BoxError = Box; pub struct Error { /// Source of the error (if applicable). #[cfg(feature = "std")] - source: Option, + source: Option>, } impl Error { @@ -43,7 +37,9 @@ impl Error { /// communication/authentication errors with HSMs, KMS, etc. #[cfg(feature = "std")] #[cfg_attr(docsrs, doc(cfg(feature = "std")))] - pub fn from_source(source: impl Into) -> Self { + pub fn from_source( + source: impl Into>, + ) -> Self { Self { source: Some(source.into()), } @@ -57,8 +53,8 @@ impl Display for Error { } #[cfg(feature = "std")] -impl From for Error { - fn from(source: BoxError) -> Error { +impl From> for Error { + fn from(source: Box) -> Error { Self::from_source(source) } }