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

hrp len const fn #212

Merged
merged 1 commit into from
Feb 9, 2025
Merged

Conversation

tzemanovic
Copy link
Contributor

makes the Hrp::len a const fn

Copy link
Member

@clarkmoody clarkmoody left a comment

Choose a reason for hiding this comment

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

ACK 72ad45a

@tcharding
Copy link
Member

What is the motivation? Just because we can and its better? If so perhaps we do FieldVec::len at the same time. I checked all the other len functions and they are all ExactSizedIterator trait methods so cannot be const.

@apoelstra
Copy link
Member

Every pure function should be const, unless there are compiler limitations (such as them being trait methods) that prevent it, or we expect to run into compiler limitations with future refactorings.

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 72ad45a; successfully ran local tests

@apoelstra apoelstra merged commit a19e843 into rust-bitcoin:master Feb 9, 2025
15 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.

4 participants