Skip to content
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

Merged
merged 2 commits into from Feb 22, 2023

Conversation

lorenzolfm
Copy link
Contributor

P: AsRef<[ChildNumber]> means that path can be borrowed as a reference to a slice of ChildNumber.

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 of ChildNumber also works and does not consume heap

Kixunil
Kixunil previously approved these changes Feb 21, 2023
Copy link
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 673ca2d

@@ -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>`.
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f69363d

@Kixunil Kixunil added documentation trivial Obvious, easy and quick to review (few lines or doc-only...) one ack PRs that have one ACK, so one more can progress them labels Feb 21, 2023
@Kixunil Kixunil added this to the 0.30.0 milestone Feb 21, 2023
@Kixunil
Copy link
Collaborator

Kixunil commented Feb 21, 2023

Added 0.30 milestone so that the documentation is updated.

Copy link
Member

@tcharding tcharding left a 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.

Copy link
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f69363d

@apoelstra apoelstra merged commit 97c925a into rust-bitcoin:master Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one ack PRs that have one ACK, so one more can progress them trivial Obvious, easy and quick to review (few lines or doc-only...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants