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

support boxing large/all oneof fields #1209

Open
xxchan opened this issue Dec 20, 2024 · 1 comment
Open

support boxing large/all oneof fields #1209

xxchan opened this issue Dec 20, 2024 · 1 comment

Comments

@xxchan
Copy link

xxchan commented Dec 20, 2024

https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant

currently, we can box a variant manually. It would be good to automatically box based on size, or just all variants

@xxchan xxchan changed the title support boxing large enum fields support boxing large/all enum fields Dec 20, 2024
@caspermeijn
Copy link
Collaborator

I assume this is about oneof fields.

The prost-derive macros don't have access to the size of a Rust type. So I think it is not possible to automatically box based on size.

Boxing all variants of a oneof field is interesting. Maybe that should happen when the name of the oneof is given to Config::boxed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants