Skip to content

Better handling of Hashmaps#5

Open
Jazzpirate wants to merge 10 commits intooperutka:masterfrom
Jazzpirate:hashmaps
Open

Better handling of Hashmaps#5
Jazzpirate wants to merge 10 commits intooperutka:masterfrom
Jazzpirate:hashmaps

Conversation

@Jazzpirate
Copy link
Copy Markdown

(builds on my other pull request for Box/Rc/Arc, but can be easily disentangled).

The blanket implementation for HashMaps has two too-narrow properties that can be generalized easily, as done by this pull requests:

  • it disregarded the Hasher implementation in the generics for HashMap, i.e. it used HashMap<K,V> instead of HashMap<K,V,S>, which doesn't allow for using popular hashing crates such as fxhash and rustc_hash,
  • it required that the keys implement From<Cow<'static, str>> - this PR generalizes this to TryFrom to allow for possibly fallible parsing of HashMap keys.

The latter could be changed to requiring serde_lite::Deserialize instead, with the implicit contract that the Intermediate used has to be a string, but that would a breaking change, whereas everything else in this PR should be backwards compatible.

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.

1 participant