From e6084a1af8c6d192ffd2f3e3041d7c622c8bdef7 Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Fri, 7 Jan 2022 13:58:47 +1100 Subject: [PATCH 1/2] Improve documentation around EcdsaSig Improve the rustdocs for serialization methods of the `EcdsaSig` type. --- src/util/ecdsa.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/ecdsa.rs b/src/util/ecdsa.rs index 86c738e7..37a31649 100644 --- a/src/util/ecdsa.rs +++ b/src/util/ecdsa.rs @@ -35,7 +35,7 @@ pub struct EcdsaSig { } impl EcdsaSig { - /// Constructs ECDSA bitcoin signature for [`EcdsaSighashType::All`] + /// Constructs an ECDSA bitcoin signature for [`EcdsaSighashType::All`]. pub fn sighash_all(sig: secp256k1::ecdsa::Signature) -> EcdsaSig { EcdsaSig { sig, @@ -43,7 +43,7 @@ impl EcdsaSig { } } - /// Deserialize from slice following the standardness rules for [`EcdsaSighashType`] + /// Deserializes from slice following the standardness rules for [`EcdsaSighashType`]. pub fn from_slice(sl: &[u8]) -> Result { let (hash_ty, sig) = sl.split_last() .ok_or(EcdsaSigError::EmptySignature)?; @@ -54,7 +54,7 @@ impl EcdsaSig { Ok(EcdsaSig { sig, hash_ty }) } - /// Serialize EcdsaSig + /// Serializes an ECDSA signature (inner secp256k1 signature in DER format). pub fn to_vec(&self) -> Vec { // TODO: add support to serialize to a writer to SerializedSig self.sig.serialize_der() From 90b4f1cde8349a2a14bd4ff853c4be4559db3405 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 20 Apr 2022 15:31:58 +1000 Subject: [PATCH 2/2] Clear TapTreeIter clippy warning Clippy emits warning: public documentation for `script_leaves` links to private item `TapTreeIter` I'm not exactly sure why this is but adding the generic type place holder clears the warning. --- src/util/psbt/map/output.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/psbt/map/output.rs b/src/util/psbt/map/output.rs index 75024551..57d5a57a 100644 --- a/src/util/psbt/map/output.rs +++ b/src/util/psbt/map/output.rs @@ -168,7 +168,7 @@ impl TapTree { self.0.clone() } - /// Returns [`TapTreeIter`] iterator for a taproot script tree, operating in DFS order over + /// Returns [`TapTreeIter<'_>`] iterator for a taproot script tree, operating in DFS order over /// tree [`ScriptLeaf`]s. pub fn script_leaves(&self) -> TapTreeIter { match (self.0.branch().len(), self.0.branch().last()) {