From 86f8043e801c624731673283a3ee27c6b88edbd2 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 12 Feb 2024 13:25:38 +1100 Subject: [PATCH] Remove Error suffix from variant We do not use a suffix on error variants, remove it. --- bitcoin/src/crypto/key.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bitcoin/src/crypto/key.rs b/bitcoin/src/crypto/key.rs index 4bc8b3fb..fd363813 100644 --- a/bitcoin/src/crypto/key.rs +++ b/bitcoin/src/crypto/key.rs @@ -1007,7 +1007,7 @@ pub enum ParseCompressedPublicKeyError { /// Secp256k1 Error. Secp256k1(secp256k1::Error), /// hex to array conversion error. - HexError(hex::HexToArrayError), + Hex(hex::HexToArrayError), } impl fmt::Display for ParseCompressedPublicKeyError { @@ -1015,7 +1015,7 @@ impl fmt::Display for ParseCompressedPublicKeyError { use ParseCompressedPublicKeyError::*; match self { Secp256k1(e) => write_err!(f, "secp256k1 error"; e), - HexError(e) => write_err!(f, "invalid hex"; e) + Hex(e) => write_err!(f, "invalid hex"; e) } } } @@ -1027,7 +1027,7 @@ impl std::error::Error for ParseCompressedPublicKeyError { match self { Secp256k1(e) => Some(e), - HexError(e) => Some(e), + Hex(e) => Some(e), } } } @@ -1037,7 +1037,7 @@ impl From for ParseCompressedPublicKeyError { } impl From for ParseCompressedPublicKeyError { - fn from(e: hex::HexToArrayError) -> Self { Self::HexError(e) } + fn from(e: hex::HexToArrayError) -> Self { Self::Hex(e) } } /// Segwit public keys must always be compressed.