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

Made the TS implementation for hashmap and hashset generic over all hashers #173

Merged

Conversation

VictorKoenders
Copy link
Contributor

@VictorKoenders VictorKoenders commented Oct 14, 2023

By default the hasher is RandomState but developers can override this. This PR makes ts-rs usable with e.g. https://docs.rs/rustc-hash/latest/rustc_hash/.

@VictorKoenders
Copy link
Contributor Author

Added tests for HashMap, HashSet and examples on how to use custom hashers.

It seems like you can't use HashMap<K, V, CustomHasher> directly because the TS derive requires that all type arguments extend from TS. However with a type alias it works perfectly fine.

@escritorio-gustavo
Copy link
Contributor

LGTM. I edited your tests to expect types instead of interfaces due to #203

@NyxCode
Copy link
Collaborator

NyxCode commented Jan 25, 2024

Great! Don't see any problems, here, so let's get this merged. Thanks @VictorKoenders for the PR, and thanks @escritorio-gustavo for taking a look!

@NyxCode NyxCode merged commit d6b862f into Aleph-Alpha:main Jan 25, 2024
2 checks passed
@VictorKoenders VictorKoenders deleted the hashmap-hashset-generic-hasher branch January 26, 2024 06:46
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.

None yet

3 participants