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

Make #[non_exhaustive] for oneofs configurable #726

Merged

Conversation

akonradi-signal
Copy link
Contributor

Add a configuration option to disable annotating generated enum types for proto oneofs with #[non_exhaustive]. The annotation makes sense for self-contained crates, but it's convenient to be able to turn it off.

One use case is for larger projects that consist of multiple crates that are developed together. Being unable to exhaustively match on the contents of oneofs not just in the crate that includes the generated protobuf code is very useful.

Add a configuration option to disable annotating generated enum types
for proto `oneof`s with `#[non_exhaustive]`. The annotation makes sense
for self-contained crates, but it's convenient to be able to turn it
off.

One use case is for larger projects that consist of multiple crates that
are developed together. Being unable to exhaustively match on the
contents of `oneof`s not just in the crate that includes the generated
protobuf code is very useful.
@stepancheg
Copy link
Owner

Pr looks good, but can you please add a test?

@akonradi-signal
Copy link
Contributor Author

Done!

@stepancheg stepancheg merged commit 764eb29 into stepancheg:master Jun 17, 2024
10 checks passed
@stepancheg
Copy link
Owner

Thanks!

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