This repository was archived by the owner on Nov 6, 2020. It is now read-only.
fix compilation warnings#11522
Merged
Merged
Conversation
dvdplm
approved these changes
Feb 26, 2020
niklasad1
reviewed
Feb 26, 2020
| } | ||
|
|
||
| impl<K: Eq + Hash, V> Len for HashMap<K, V> { | ||
| impl<K: Eq + Hash, V, S: std::hash::BuildHasher> Len for HashMap<K, V, S> { |
Collaborator
There was a problem hiding this comment.
question: does this make it more generic instead of using https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html?
Member
Author
There was a problem hiding this comment.
that's what the compiler told me to do
warning: impl for `HashMap` should be generalized over different hashers
--> util/len-caching-lock/src/lib.rs:69:31
|
69 | impl<K: Eq + Hash, V> Len for HashMap<K, V> {
| ^^^^^^^^^^^^^
|
= note: `#[warn(clippy::implicit_hasher)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_hasher
help: consider adding a type parameter
|
69 | impl<K: Eq + Hash, V, S: ::std::hash::BuildHasher> Len for HashMap<K, V, S> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
🤷♂️
Collaborator
There was a problem hiding this comment.
Ok, yeah I think what I wrote is correct because https://doc.rust-lang.org/src/std/collections/hash/map.rs.html#202, uses a default type parameter. Then you can't use your custom Hasher.
Clippy lint: https://rust-lang.github.io/rust-clippy/master/#implicit_hasher
niklasad1
approved these changes
Feb 26, 2020
ordian
added a commit
that referenced
this pull request
Feb 26, 2020
* master: fix compilation warnings (#11522)
ordian
added a commit
that referenced
this pull request
Mar 6, 2020
* master: (27 commits) Faster kill_garbage (#11514) [EngineSigner]: don't sign message with only zeroes (#11524) fix compilation warnings (#11522) [ethcore cleanup]: various unrelated fixes from `#11493` (#11507) Add benchmark for transaction execution (#11509) Add Smart Contract License v1.0 Misc fixes (#11510) [dependencies]: unify `rustc-hex` (#11506) Activate on-chain randomness in POA Sokol (#11505) Grab bag of cleanup (#11504) Implement eth/64 (EIP-2364) and drop support for eth/62 (#11472) [dependencies]: remove `util/macros` (#11501) OpenEthereum bootnodes are added (#11499) [ci benches]: use `all-features` (#11496) [verification]: make test-build compile standalone (#11495) complete null-signatures removal (#11491) Include the seal when populating the header for a new block (#11475) fix compilation warnings (#11492) cargo update -p cmake (#11490) update to published rlp-derive (#11489) ...
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.