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

extensions: Group enum extension variants together per impl T block #519

Merged
merged 1 commit into from
Dec 20, 2021

Conversation

MarijnS95
Copy link
Collaborator

Instead of generating an impl block - together with "Generated from XXX" doc - for every single item that extends an enum type, group all these extensions together in a single impl block per extension per type.

This cuts down a couple thousand lines of repeated impl T and #[doc] annotations, and makes the code more readable at the same time: it is now possible to immediately see exactly all the constants that a certain extension extends a type with.

Instead of generating an impl block - together with "Generated from XXX"
doc - for every single item that extends an enum type, group all these
extensions together in a single `impl` block per extension per type.

This cuts down a couple thousand lines of repeated `impl T` and `#[doc]`
annotations, and makes the code more readable at the same time: it is
now possible to immediately see exactly all the constants that a certain
extension extends a type with.
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Nice!

@Ralith Ralith merged commit 87b0056 into master Dec 20, 2021
@Ralith Ralith deleted the group-enum-extensions-impl-blocks branch December 20, 2021 23:16
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.

2 participants