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

Clean up the hashes dependency/feature #628

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

tcharding
Copy link
Member

@tcharding tcharding commented Jul 14, 2023

Use the more terse hashes by way of the package field in the manifest.

Allows us to remove the ugly feature alias "bitcoin-hashes" -> "bitcoin_hashes" and removes all the bother with the underscore.

@tcharding tcharding marked this pull request as draft July 14, 2023 03:01
@tcharding tcharding force-pushed the 07-14-hashes-dep branch 3 times, most recently from 8f94237 to 446e045 Compare July 17, 2023 23:41
@tcharding tcharding marked this pull request as ready for review July 17, 2023 23:42
@@ -21,8 +21,7 @@ default = ["std"]
std = ["alloc", "secp256k1-sys/std"]
# allow use of Secp256k1::new and related API that requires an allocator
alloc = ["secp256k1-sys/alloc"]
bitcoin-hashes = ["bitcoin_hashes"] # Feature alias because of the underscore.
bitcoin-hashes-std = ["std", "bitcoin_hashes", "bitcoin_hashes/std"]
hashes-std = ["std", "hashes/std"]
Copy link
Member

Choose a reason for hiding this comment

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

Whenever we hit MSRV 1.60 we can replace all the -std ones with:
std = ["hashes?/std"]

Copy link
Member Author

Choose a reason for hiding this comment

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

Already tracked here: rust-bitcoin/rust-bitcoin#1722 but thanks for mentioning, I didn't actually know what "weak dependencies" meant - TIL.

elichai
elichai previously approved these changes Jul 19, 2023
Copy link
Member

@elichai elichai left a comment

Choose a reason for hiding this comment

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

ACK, only went over the diff 446e045

sanket1729
sanket1729 previously approved these changes Jul 19, 2023
Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

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

utACK 446e045.

@tcharding tcharding dismissed stale reviews from sanket1729 and elichai via 299952b July 20, 2023 01:09
@tcharding tcharding force-pushed the 07-14-hashes-dep branch 2 times, most recently from 299952b to c5279be Compare July 20, 2023 01:11
@tcharding tcharding marked this pull request as draft July 20, 2023 03:56
@tcharding tcharding force-pushed the 07-14-hashes-dep branch 2 times, most recently from dd78b87 to a522bf2 Compare August 14, 2023 04:54
@tcharding tcharding marked this pull request as ready for review August 14, 2023 04:55
@tcharding tcharding marked this pull request as draft August 14, 2023 06:18
@tcharding
Copy link
Member Author

I botched the rebase, will fix tomorrow.

@tcharding tcharding force-pushed the 07-14-hashes-dep branch 4 times, most recently from 6cec5e7 to c965c94 Compare August 15, 2023 04:50
Use the more terse `hashes` by way of the `package` field in the
manifest.

Allows us to remove the ugly feature alias "bitcoin-hashes" ->
"bitcoin_hashes" and removes all the bother with the underscore.

Why did we not think of this 2 years ago?
Now that we have `hashes` as the crate name of `bitcoin_hashes` we can
slightly clean up the import statements.

This is based on the convention we have to import things directly from
the crate if we depend on it and not from the crate level re-export.
@tcharding tcharding marked this pull request as ready for review August 15, 2023 04:55
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK 6fdd3b1

@apoelstra apoelstra merged commit 1f9c01a into rust-bitcoin:master Aug 15, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants