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

Use FromStr trait for parsing #4

Merged
merged 1 commit into from
Mar 7, 2018
Merged

Conversation

sgeisler
Copy link
Contributor

@sgeisler sgeisler commented Mar 7, 2018

Using FromStr potentially saves one clone() since the bech32 input string doesn't have to be moved into the from_string function. Since the string is never consumed inside the function this should not change the it's behavior.

@clarkmoody
Copy link
Member

This looks great, thanks! More idiomatic Rust is always appreciated.

I'll need to see how this affects the sister rust-bech32-bitcoin library before pushing an update to Crates.io.

I'm also working on adding convert_bits to this library, according to #3

@clarkmoody clarkmoody merged commit a9f0424 into rust-bitcoin:master Mar 7, 2018
@sgeisler
Copy link
Contributor Author

sgeisler commented Mar 7, 2018

I'll need to see how this affects the sister rust-bech32-bitcoin library before pushing an update to Crates.io.

Maybe we should have a look at other API-breaking changes that might be desirable first. I'll open an issue to collect API cleanup ideas.

I'm also working on adding convert_bits to this library, according to #3

I'm looking forward to it :) I could use it to get rid of a horribly inefficient implementation of base32_to_base256 (I'm implementing BOLT 11 payment parsing)

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.

None yet

2 participants