-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow infallible construction of Signature
#730
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I haven't noticed that signatures actually don't have any invariants (other than length). Concept ACK though I'm not sure about the renaming of serialize
.
Also the title is misleading since this is not what "zero copy" means. "Zero copy" is just a stupid name for "zero heap allocations" and the original code didn't do any heap allocations in the first place. Further, in What I believe is non-controversial about this PR: we want some infallible method that accepts an array. I wanted to suggest you to make just that change first but then I remembered about |
Neat! Concept ACK. I would like to use |
* Add `Signature::from_byte_array` constructor * Add `Signature::to_byte_array` and `Signature::as_byte_array` methods * Deprecate `Signature::serialize` method Signed-off-by: Yuki Kishimoto <[email protected]>
Signature
constructionSignature
Ahh, thanks for the clarification I've done the changes as suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 23b87a6
@@ -88,9 +91,17 @@ impl Signature { | |||
} | |||
|
|||
/// Returns a signature as a byte array. | |||
#[inline] | |||
#[deprecated(since = "0.30.0", note = "Use `to_byte_array` instead.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use TBD
in since and mass-replace it during release but there isn't anything wrong with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 23b87a6 successfully ran local tests
Hi! This PR add 1 constructor and 2 methods to
Signature
struct:Signature::from_byte_array
constructorSignature::to_byte_array
andSignature::as_byte_array
methodsSignature::serialize
method