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

Add support for custom hashers #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mjclarke94
Copy link

Attempts to close #32. Still needs documentation etc, but figured I'd get the initial PR up for code review.

I'm fairly new to rust so feel free to be brutal here! It's likely that I'm missing something obvious here.

I was looking into whether it would be plausible to also be generic over the map type (say, to allow BTreeMap instead of HashMap which might be handy when it comes to things like k_most_common, but was struggling to see how to make it be generic over both.

Adds a random state `S` as a generic type, and uses the standard
RandomState to maintain backward compatibility.
@mjclarke94 mjclarke94 marked this pull request as ready for review December 3, 2024 17:41
@coriolinus
Copy link
Owner

Thanks for the contribution! It's likely to be a few days before I can properly review this--life is hectic right now--but I have seen it, and it's on my task queue.

@mjclarke94
Copy link
Author

I'm installing off my fork for the time being so no rush on my end :)
This is just the result of me getting carried away trying to optimise an advent of code solution!

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.

Suggestion: make Counter generic over the hashing algorithm
2 participants