-
Notifications
You must be signed in to change notification settings - Fork 923
Move impl_array_newtype to internals
#5334
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
Conversation
Perhaps remove it from the macro but put an impl block on each type that calls the macro with the deprecated function. I was hesitant when I read the PR title because of my distrust of macros, but this one is pretty good. So FWIW concept ACK that. Will review. |
964b66f to
697789d
Compare
|
Moved deprecated method to I neglected the method in |
rockcoolsaint
left a comment
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.
The changes moved without breaking existing tests
|
Agreed, this macro seems okay. Importantly it does not use anything from other crates except core/std. concept ACK. |
apoelstra
left a comment
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 697789d; successfully ran local tests
|
ACK 697789d |
|
@tcharding when you get a moment, you said "will review" so I'll hold off on merging til you do. |
|
Oooph, sorry I meant to do it that day. |
tcharding
left a comment
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 697789d
bitcoin/src/bip32.rs
Outdated
| internal_macros::impl_array_newtype!(ChainCode, u8, 32); | ||
| impl_array_newtype!(ChainCode, u8, 32); |
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.
nit: I'd prefer one level of path, wi have been working towards doing so for macros repo wide.
internals::impl_arry_newtyp! ...
8b4c773
697789d to
8b4c773
Compare
Discussion rust-bitcoin#5331 suggested removing `bitcoin` as a direct dependency could be a reasonable goal for the `p2p` crate. One conflict along the way is the use of this macro in `bip152` to implement the array-like traits for the short IDs. Because `bitcoin` depends on `internals`, as does `p2p`, we can move this macro into `internals` to help detangle `p2p` and `bitcoin`. Moves the deprecated methods to the `impl` blocks.
8b4c773 to
20cd232
Compare
|
Addressed all the imports in 20cd232 |
tcharding
left a comment
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 20cd232
|
Thanks mate. |
apoelstra
left a comment
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 20cd232; successfully ran local tests
Discussion #5331 suggested removing
bitcoinas a direct dependency could be a reasonable goal for thep2pcrate. One conflict along the way is the use of this macro inbip152to implement the array-like traits for the short IDs. Becausebitcoindepends oninternals, as doesp2p, we can move this macro intointernalsto help detanglep2pandbitcoin.Does it make sense to also remove the deprecated method?