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
Changing docs and examples to use correct function signature #1658
Conversation
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 673ca2d
bitcoin/src/bip32.rs
Outdated
@@ -683,7 +683,7 @@ impl ExtendedPubKey { | |||
|
|||
/// Attempts to derive an extended public key from a path. | |||
/// | |||
/// The `path` argument can be both of type `DerivationPath` or `Vec<ChildNumber>`. | |||
/// The `path` argument can be both of type `DerivationPath` or `AsRef<ChildNumber>`. |
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.
"can be of any type implementing AsRef<ChildNumber
" would be a bit more natural.
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.
Fixed in f69363d
Added 0.30 milestone so that the documentation is updated. |
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 f69363d
Thanks for taking the time to improve this, appreciate the effort.
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 f69363d
P: AsRef<[ChildNumber]>
means that path can be borrowed as a reference to a slice ofChildNumber
.While it does work with
Vec
, the documentation and examples mislead the user into thinking that he/she has to use a vec, which is not true. A simple reference to a slice ofChildNumber
also works and does not consume heap