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

Deserialize hexes without allocating intermediate Vec<u8> #241

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

RCasatta
Copy link
Collaborator

@RCasatta RCasatta commented Aug 30, 2022

Since HexIterator is Read we can feed it directly to consensus_decode
without the intermediate step of converting the hex string to Vec<u8>

Could be applied on other fields, but they are now deserialized with serde_hex as Vec<u8>, we may consider keeping them String and then converting them with deserialize_hex

Since `HexIterator` is `Read` we can feed him directly to `consensus_decode`
without the intermediate step of converting the hex string to `Vec<u8>`
@stevenroose
Copy link
Collaborator

I love this :)

@stevenroose stevenroose merged commit fef1b64 into rust-bitcoin:master Sep 20, 2022
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