fix(taproot): remove unused error variant

- clippy::enum_variant_names allow attribute added
- cargo formatting changes reversed
This commit is contained in:
aagbotemi 2025-04-22 14:23:36 +01:00
parent ddd27eddc4
commit dedb42dd71
No known key found for this signature in database
GPG Key ID: 37C137D831F0A852
1 changed files with 2 additions and 4 deletions

View File

@ -1510,6 +1510,7 @@ impl From<InvalidMerkleTreeDepthError> 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<Infallible> 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,
}
}
}