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

Derive Hash for Language #2080

Merged
merged 1 commit into from Feb 9, 2023
Merged

Derive Hash for Language #2080

merged 1 commit into from Feb 9, 2023

Conversation

Ekleog
Copy link
Contributor

@Ekleog Ekleog commented Feb 9, 2023

Given Language implements Eq, it can probably implement Hash too.

This makes it easy to derive a random identifier from a Language

For some context, I'm currently writing a creduce-like based on tree-sitter (not yet ready for prime time, though cargo run --bin rsreduce already kinda works), and am trying to derive a random identifier for passes so that the user can know which log lines refer to the same pass. Among the things in a pass is the Language, and though I could just not hash it, I don't see any reason not to :)

Given Language implements Eq, it can probably implement Hash too.

This makes it easy to derive a random identifier from a `Language`
@maxbrunsfeld maxbrunsfeld merged commit 8389ffd into tree-sitter:master Feb 9, 2023
@maxbrunsfeld
Copy link
Contributor

Thanks!

@Ekleog
Copy link
Contributor Author

Ekleog commented Feb 9, 2023

Well, thank you for the quick merge and work on tree-sitter! :)

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

2 participants