Skip to content

Make iter module public#203

Merged
apoelstra merged 3 commits intorust-bitcoin:1.xfrom
tcharding:push-rmpowzwznlkm
Feb 24, 2026
Merged

Make iter module public#203
apoelstra merged 3 commits intorust-bitcoin:1.xfrom
tcharding:push-rmpowzwznlkm

Conversation

@tcharding
Copy link
Copy Markdown
Member

Do a couple of preparatory patches then make the module pubic as well as the HexToBytesIter::new constructor. With this applied exactly two types will be added to the public API: HexToBytesIter and the helper HexDigitsIter. The former can only be constructed using new and the latter does not provide a constructor. It is meant for usage only if one needs to refer to the iter type explicitly as HexToBytesIter<HexDigitsIter>.

Note we do not add the HexSliceToBytesIter alias from master. If required that can be done as a follow up because as is this PR only touches code on the 1.x branch already.

Done in preparation for making the `iter` module public. We want the
API to be as small as possible to give maximum maintenance
flexibility.

The `from_pairs` function is used internally and does not need to be
public. We expect users to construct the `HexToBytesIter` using `new`.
We did not include the `HexSliceToBytesIter` alias in the 1.0 release.
Remove mention of it from docs.
The module contains exactly two types, the `HexToBytesIter` and the
helper `HexDigitsIter`. The former can only be constructed using `new`
and the latter does not provide a constructor. It is meant for usage
only if one needs to refer to the iter type explicitly as
`HexToBytesIter<HexDigitsIter>`.
@tcharding tcharding changed the base branch from 0.1.x to 1.x February 24, 2026 00:25
@tcharding
Copy link
Copy Markdown
Member Author

Woops wrong base.

@tcharding
Copy link
Copy Markdown
Member Author

Note no CI here when targeting 1.x branch.

Copy link
Copy Markdown
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 508962b; successfully ran local tests; yep, this API seems totally reasonable to me.

@apoelstra apoelstra merged commit b26d2eb into rust-bitcoin:1.x Feb 24, 2026
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.

2 participants