-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #2746: hashes: Modify trait bounds
d094350 hashes: Modify trait bounds (Tobin C. Harding) Pull request description: Currently we require indexing trait bounds as well as `Borrow` on the `Hash` trait. We also already implement `AsRef`. It was observed that `Borrow<[u8]>` does not best describe what we want from the `Hash` trait implementor but rather `AsRef<[u8]>` does. Remove all the inexing trait bounds. Remove the `borrow::Borrow<[u8]>` trait bound. Add a `convert::AsRef<[u8]>` trait bound. This leaves the `Borrow<[u8]>` implementation for hashes created with `hash_newtype`, I'm not sure if this should be removed or not. ACKs for top commit: apoelstra: ACK d094350 thanks! FWIW I think we might want to return the indexing traits one day, at least `[..]`, but we can do that post-1.0 and we have not gotten any complaints after removing them from the non-HMAC hashes, so maybe people are good with it as is. Tree-SHA512: 2704a7e850083e4eae5844c401c6ac6fe32e0939bbe6e0fb5e21faf4745f9c98634e210f522199ceacd663be60685d7f30df6c89a7787ca11ea8294d104d813e
- Loading branch information
Showing
4 changed files
with
14 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters