Skip to content

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
@nazar-pc
Copy link

Could someone publish a new release with this change, please?

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.

5 participants