Skip to content

Implement From<ChecksumError> for DecodeError #221

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevenroose
Copy link
Contributor

Noticed this was missing.

@apoelstra
Copy link
Member

Yeah, concept ACK being consistent here. We should have one or both. Will assume that we should go with "both" unless @clarkmoody steps in and says otherwise.

But personally I've been moving away from these From impls. It's not a lot of extra code to add .map_err(DecodeError::Checksum) before ?, makes it waaay easier to grep for (and git log -S for) where each variant is used, and it keeps the public API tighter.

I also increasingly think that ? being a single character was a mistake for Rust, because it makes it incredibly easy to propagate errors without adding any useful context. If I'm already using .map_err everywhere it's a smaller difference between adding context and not.

@clarkmoody
Copy link
Member

Concept ACK from me.

Personally, I like the ? operator 😉

apoelstra added a commit that referenced this pull request Aug 2, 2025
7a3f493 ci: update checkout and cache to v4; runner to ubuntu-latest. (Andrew Poelstra)
62a9d53 add weekly cronjob to update nightly-version (Andrew Poelstra)
4c00b93 introduce nightly-version file (copied from rust-bitcoin) and use it in CI (Andrew Poelstra)
720992b clippy: fix new lifetime lint (Andrew Poelstra (aider))

Pull request description:

  Right now I can't test #220 or #221 locally because clippy is failing with the latest nightly.
  
  I can disable the local clippy check but I'd prefer to fix it here.
  
  Should unblock both those PRs.


ACKs for top commit:
  clarkmoody:
    ACK 7a3f493


Tree-SHA512: 725177b18bce543c6c114ce0ee6ef04bc6862c440a2fff9b99d607b912f6ab2c0eab22ecf03abc89332519aa9ffc4ddd624d16abfce0c6d4fefad53a87eb5249
@apoelstra
Copy link
Member

concept ACK -- if you rebase on #223 I can do a tested ACK.

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.

3 participants