-
Notifications
You must be signed in to change notification settings - Fork 9
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
DEMO: Pull errors into a separate crate #161
Conversation
0832cd5
to
abf5571
Compare
The only thing used in `primitives` and `hashes` from the `hex` crate is the error types (actually just the `HexToArrayError` and inner types). In an effort to stabalise more quickly pull the error types out into a separate crate. Set the version to `1.0.0-alpha.0` and release it already.
abf5571
to
12d0331
Compare
|
||
impl InvalidCharError { | ||
/// Constructs a new error. | ||
pub fn new(invalid: u8, pos: usize) -> Self { Self { invalid, pos } } |
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.
We definitely cannot have this. It's effectively equivalent to publishing the fields. The only way to get the errors should be by attempting to decode something.
Note also that I was very deliberate in naming in my proposal - instead of stable -errors
crate I suggested -unstable
crate for two reasons: 1) because it'd also stabilize inherent deserialization functions, so "errors" is misleading 2) to not need to maintain two crates forever for no reason. Once the entire content of -unstable
crate is stabilized (by moving to the hex-conservative
) we can simply abandon the -unstable
crate.
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.
Ok. However we can stick with the 'create stable crate' strategy if we move FromHex
into it as well. Demo'd in #162 and #163 (and used in rust-bitcoin: rust-bitcoin/rust-bitcoin#4110).
As per our discussion the other day, I think we should do this on a separate 1.0 branch rather in a separate crate. |
Yep lets have a go at that. Cheers |
The only thing used in
primitives
andhashes
from thehex
crate is the error types (actually just theHexToArrayError
and inner types).In an effort to stabalise more quickly pull the error types out into a separate crate. Set the version to
1.0.0-alpha.0
and release it already.