From 036bd0d011247575e32c847d5ab1d963588b5222 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 24 Nov 2022 05:23:59 +1100 Subject: [PATCH 1/3] secp256k1: Generalize docs on Error The `Error` type is the main general error used by this lib, it is not specific to ECDSA. Fix the docs to show this. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index a443560..777ee43 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -299,7 +299,7 @@ impl fmt::Display for Message { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) } } -/// An ECDSA error +/// The main error type for this library. #[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Debug)] pub enum Error { /// Signature failed verification From 96f9fd3e56b9a6eda4757c83abb18aa24d4e6607 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 24 Nov 2022 05:25:57 +1100 Subject: [PATCH 2/3] Link to MESSAGE_SIZE in Error docs We can help readers of the HTML docs by using a link to the constant. While we are at it shorten the doc comment so it fits on one line (in under 100 chars). --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 777ee43..3451c73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -304,8 +304,7 @@ impl fmt::Display for Message { pub enum Error { /// Signature failed verification IncorrectSignature, - /// Badly sized message ("messages" are actually fixed-sized digests; see the `MESSAGE_SIZE` - /// constant). + /// Bad sized message ("messages" are actually fixed-sized digests [`constants::MESSAGE_SIZE`]). InvalidMessage, /// Bad public key. InvalidPublicKey, From 42bf99f11bfda421e7ac3d263c3db5270389b633 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 24 Nov 2022 05:27:50 +1100 Subject: [PATCH 3/3] Add full stop The docs on `Error` are almost perfect, add a missing full stop. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3451c73..744bb4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -302,7 +302,7 @@ impl fmt::Display for Message { /// The main error type for this library. #[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Debug)] pub enum Error { - /// Signature failed verification + /// Signature failed verification. IncorrectSignature, /// Bad sized message ("messages" are actually fixed-sized digests [`constants::MESSAGE_SIZE`]). InvalidMessage,