crypto: Fix lint errors in crypto::taproot
What changed, and why it matters
This commit only fixes code style and documentation lint warnings in the crypto::taproot module. It adds missing documentation comments and formats an existing doc comment. There are no changes to program logic, security behavior, or cryptographic operations.
No security action needed. Treat as a routine documentation/lint cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds # Errors documentation sections to Signature::from_slice and SerializedSignature::to_signature, and wraps SerializedSignature in backticks in a doc comment. No executable code, signatures, parsing logic, or error handling paths were modified.
Changed components
crypto/src/taproot.rsInspect captured patch +11 / −1
diff --git a/crypto/src/taproot.rs b/crypto/src/taproot.rs
index 9fa33110..9ed47d87 100644
--- a/crypto/src/taproot.rs
+++ b/crypto/src/taproot.rs
@@ -40,6 +40,12 @@ pub struct Signature {
impl Signature {
/// Deserializes the signature from a slice.
+ ///
+ /// # Errors
+ ///
+ /// - [`SigFromSliceError::InvalidSignatureSize`] if the input slice is not 64 or 65 bytes.
+ /// - [`SigFromSliceError::SighashType`] if the sighash type is invalid or the sighash type
+ /// is default and the slice is 65 bytes.
pub fn from_slice(sl: &[u8]) -> Result<Self, SigFromSliceError> {
if let Ok(signature) = <[u8; 64]>::try_from(sl) {
// default type
@@ -123,7 +129,7 @@ pub struct SerializedSignature {
}
impl SerializedSignature {
- /// Constructs a new SerializedSignature from a Signature.
+ /// Constructs a new `SerializedSignature` from a Signature.
///
/// In other words this serializes a `Signature` into a `SerializedSignature`.
#[inline]
@@ -132,6 +138,10 @@ impl SerializedSignature {
/// Converts the serialized signature into the [`Signature`] struct.
///
/// In other words this deserializes the `SerializedSignature`.
+ ///
+ /// # Errors
+ ///
+ /// See [`Signature::from_slice`].
#[inline]
pub fn to_signature(self) -> Result<Signature, SigFromSliceError> {
Signature::from_slice(&self)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.