-
Notifications
You must be signed in to change notification settings - Fork 640
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
Re-export UnprefixedHexError in the bitcoin crate root #2895
Conversation
Pull Request Test Coverage Report for Build 9618532760Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 535d702
Please commit the API changes. |
Pull Request Test Coverage Report for Build 9636043739Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9636987268Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
should i squash them all into one commit? |
There are a few problems with this PR:
#2874 is not a trivial issue to solve, it requires quite some thought (that is why I raised the issue instead of fixing the problem). For more context, for niche error types we typically expose the module so users can do So basically, the re-export of To move forward, and to close the issue, there needs to be some thought put into the |
Ah bother, the check-api EDIT: Resolved in #2900 |
Your check-api problems stem from, I believe, the method used to install See #2900 for context. |
I did some digging and realized this was the issue and ran |
I've only started taking a look at the repo recently - do we know how niche the |
Ah I misspoke, I should not have said "niche", I should have said "for error useage we typically expose the module". I.e., we need a module so users can do pub use bitcoin::parse;
...
// The use `parse::UnprefixedHexError` or should they have to go to pub use bitcoin::units::parse; (Remembering that we are missing a |
hmm i think that since that those error types aren't used only for the types in
to
without affecting the end user. Would like to hear your thoughts to make sure I didn't miss anything |
I think you are right and this is the best approach. I would improve your suggestion by writing it like this As of today (this PR), put in pub mod parse {
//! Parsing utilities.
/// Re-export everything from the [`units::parse`] module.
#[doc(inline)]
pub use units::parse::{ParseIntError, UnprefixedHexError}; // TODO: Add all public structs, enums, and functions
} In the not-too-distant-future when we have use bitcoin::parse;
use primitives::parse;
use units::parse; So in pub mod parse {
//! Parsing utilities.
/// Re-export everything from the [`units::parse`] module.
#[doc(inline)]
pub use units::parse::{ParseIntError, UnprefixedHexError}; // TODO: Add all public structs, enums, and functions
} Then in pub mod parse {
//! Parsing utilities.
/// Re-export everything from the [`primitives::parse`] module.
#[doc(inline)]
pub use primitives::parse::{ParseIntError, UnprefixedHexError}; // TODO: Add all public structs, enums, and functions
} @Kixunil and @apoelstra should probably weigh in before you implement my ideas :) |
Yeah, that looks good to me. |
Nice, we can move forward on this @shinghim. We are in the process of eliminating wildcard imports so just in case you get tempted please don't use |
Pull Request Test Coverage Report for Build 9672691887Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9672938948Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9679309763Details
💛 - Coveralls |
I think it makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, unsure if we require splitting the API changes.
Pull Request Test Coverage Report for Build 9684363160Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 10440b3
Re-export UnprefixedHexError in the bitcoin crate root
Fixes #2874