Skip to content

Commit

Permalink
Refactor enum generation.
Browse files Browse the repository at this point in the history
Gather all the enum variants.
This allows us to simplify some logic, make the code more readable,
by putting the actual code generation close together in
the build method.

For users, the main benefit is that Newtype enums now only
have a single impl block, instead of one impl block per
enum variant.
  • Loading branch information
jschwe committed Feb 5, 2025
1 parent 03d49b6 commit 7d9b3e9
Show file tree
Hide file tree
Showing 9 changed files with 265 additions and 268 deletions.
12 changes: 0 additions & 12 deletions bindgen-tests/tests/expectations/tests/bitfield-enum-basic.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions bindgen-tests/tests/expectations/tests/enum-doc-bitfield.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindgen-tests/tests/expectations/tests/issue-1435.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions bindgen-tests/tests/expectations/tests/newtype-enum.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7d9b3e9

Please sign in to comment.