From 7e7773f274170266d74fe17d0551ecab729ea52a Mon Sep 17 00:00:00 2001 From: Innocent Onyemaenu Date: Mon, 6 Jan 2025 22:24:35 +0100 Subject: [PATCH] In #945fcd09 we forgot to Update impl for ParsePublicKeyError Display and Error traits --- bitcoin/src/crypto/key.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index e51350afab..2d49021394 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -1036,7 +1036,7 @@ impl fmt::Display for ParsePublicKeyError { use ParsePublicKeyError::*; match self { Encoding(e) => write_err!(f, "string error"; e), - InvalidChar(char) => write!(f, "hex error {}", char), + InvalidChar(e) => write_err!(f, "hex decoding"; e), InvalidHexLength(got) => write!(f, "pubkey string should be 66 or 130 digits long, got: {}", got), } @@ -1048,9 +1048,10 @@ impl std::error::Error for ParsePublicKeyError { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { use ParsePublicKeyError::*; - match self { - Encoding(e) => Some(e), - InvalidChar(_) | InvalidHexLength(_) => None, + match *self { + Encoding(ref e) => Some(e), + InvalidChar(ref e) => Some(e), + InvalidHexLength(_) => None, } } }