Merge pull request #551 from LNP-BP/feat/key-error-derives

More derives for key::Error
This commit is contained in:
Andrew Poelstra 2021-02-21 14:14:54 +00:00 committed by GitHub
commit 81c56dec60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ use hash_types::{PubkeyHash, WPubkeyHash};
use util::base58; use util::base58;
/// A key-related error. /// A key-related error.
#[derive(Debug)] #[derive(Debug, PartialEq, Eq, Clone)]
pub enum Error { pub enum Error {
/// Base58 encoding error /// Base58 encoding error
Base58(base58::Error), Base58(base58::Error),
@ -39,8 +39,8 @@ pub enum Error {
impl fmt::Display for Error { impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self { match *self {
Error::Base58(ref e) => write!(f, "base58 error: {}", e), Error::Base58(ref e) => write!(f, "Key base58 error: {}", e),
Error::Secp256k1(ref e) => write!(f, "secp256k1 error: {}", e), Error::Secp256k1(ref e) => write!(f, "Key secp256k1 error: {}", e),
} }
} }
} }