Skip to content
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

Make RecoveryId an enum #743

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

liamaharon
Copy link
Contributor

@liamaharon liamaharon commented Sep 14, 2024

Closes #727

  • Refactors RecoveryId into an enum.
  • Replaces custom type methods from_i32 and to_i32 with TryFrom<i32> and Into<i32> (via From<RecoveryId> for i32) implementations.
  • Removes derive Ord PartialOrd and Hash, they don't appear to be used. I can implement on the enum if we want to keep them.

@apoelstra
Copy link
Member

In f6a76af:

There is an as i32 in your diff that can be converted to a i32::from. (The old code is at fault, but you're changing this line anyway so you should fix it.)

@liamaharon
Copy link
Contributor Author

Good catch @apoelstra, fixed it

@liamaharon
Copy link
Contributor Author

Force pushed a lint fix

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa0c086 successfully ran local tests

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa0c086

@apoelstra apoelstra merged commit 2a80731 into rust-bitcoin:master Sep 16, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RecoveryId should be an enum
3 participants