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

refactor: drop superfluous trait bounds #19

Merged
merged 6 commits into from
Dec 15, 2024

Conversation

ada4a
Copy link
Contributor

@ada4a ada4a commented Dec 15, 2024

As explained in the first commit, it's recommended to avoid putting trait bounds in structs, since causes the bounds to be propagated across the codebase for no added benefit.

it's recommended to leave them out of struct definitions and instead
have them in impl blocks

https://stackoverflow.com/questions/49229332/should-trait-bounds-be-duplicated-in-struct-and-impl
arguably less impactful, but nice-to-have nevertheless
this was made ppossible by removing them from `Interner`
this was made possible by all the previous commits -- `InternedInput`
now doesn't require the traits by itself, nor does
`Interner::num_tokens`
Copy link
Collaborator

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks great to me!

I'd merge, but think @pascalkuthe should have the final word on this.

@pascalkuthe pascalkuthe merged commit 226742f into pascalkuthe:master Dec 15, 2024
5 checks passed
@ada4a ada4a deleted the interner_trait_bounds branch December 15, 2024 14:15
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.

3 participants