From dedb42dd7178774cea6ce92d25d7519de52c2526 Mon Sep 17 00:00:00 2001 From: aagbotemi Date: Tue, 22 Apr 2025 14:23:36 +0100 Subject: [PATCH] fix(taproot): remove unused error variant - clippy::enum_variant_names allow attribute added - cargo formatting changes reversed --- bitcoin/src/taproot/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bitcoin/src/taproot/mod.rs b/bitcoin/src/taproot/mod.rs index d9ee3dc49..abcc8ecc4 100644 --- a/bitcoin/src/taproot/mod.rs +++ b/bitcoin/src/taproot/mod.rs @@ -1510,6 +1510,7 @@ impl From for TaprootBuilderError { /// Detailed error type for Taproot utilities. #[derive(Debug, Clone, PartialEq, Eq)] #[non_exhaustive] +#[allow(clippy::enum_variant_names)] pub enum TaprootError { /// Proof size must be a multiple of 32. InvalidMerkleBranchSize(InvalidMerkleBranchSizeError), @@ -1523,8 +1524,6 @@ pub enum TaprootError { InvalidInternalKey(secp256k1::Error), /// Invalid control block hex InvalidControlBlockHex(HexToBytesError), - /// Empty Taproot tree. - EmptyTree, } impl From for TaprootError { @@ -1542,7 +1541,6 @@ impl fmt::Display for TaprootError { InvalidControlBlockSize(ref e) => write_err!(f, "invalid control block size"; e), InvalidControlBlockHex(ref e) => write_err!(f, "invalid control block hex"; e), InvalidInternalKey(ref e) => write_err!(f, "invalid internal x-only key"; e), - EmptyTree => write!(f, "Taproot tree must contain at least one script"), } } } @@ -1557,7 +1555,7 @@ impl std::error::Error for TaprootError { InvalidTaprootLeafVersion(ref e) => Some(e), InvalidMerkleTreeDepth(ref e) => Some(e), InvalidControlBlockHex(ref e) => Some(e), - InvalidMerkleBranchSize(_) | InvalidControlBlockSize(_) | EmptyTree => None, + InvalidMerkleBranchSize(_) | InvalidControlBlockSize(_) => None, } } }