chore(submit_package): use unwrap_or_default instead of .unwrap()#159
Merged
oleonardolima merged 2 commits intobitcoindevkit:masterfrom Jan 9, 2026
Conversation
- use `unwrap_or_default()` instead of `.unwrap()`, ideally it should return a specific error variant, it'd be a breaking change though and can be added in a follow-up. - it's only possible to use the internal `minreq::Error` to wrap the `serde_json::Error`, but not the `reqwest::Error` as it does not have public constructors.
Pull Request Test Coverage Report for Build 20804402127Details
💛 - Coveralls |
Member
|
Agree, we should go with the first approach and then create proper error variants once |
Contributor
|
I found 2 more instances of |
Member
|
I think this PR only intends to address those added in the submit package PR, but these can be tackled here as well. |
Collaborator
Author
|
Yes, I only had bookmarked the ones added in the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
unwrap_or_default()instead of.unwrap(), ideally it should return a specific error variant, it'd be a breaking change though and can be added in a follow-up.minreq::Errorto wrap theserde_json::Error, but not thereqwest::Erroras it does not have public constructors.Notes to the reviewers
I personally wanted to remove the
.unwrap()and properly handle the error, though the options I had in mind:SerdeJsonvariant is a breaking change; we can do it as a follow-up for 0.13.0.unwrap_or_default()on both for now.