tokio-rs / prost

PROST! a Protocol Buffers implementation for the Rust Language
Apache License 2.0
3.69k stars 481 forks source link

style(prost-build): Consolidate field data into struct #1017

Closed mzabaluev closed 3 months ago

mzabaluev commented 4 months ago

When massaging field data in CodeGenerator::append_message, move it into lists of Field and OneofField structs so that later generation passes can operate on the data with less code duplication.

Subsidiary append_* methods are changed to take references to these structs rather than moved data, as generation of lexical tokens does not actually consume any owned data, and we will need more passes over the same field lists for the upcoming builder codegen in #901.

caspermeijn commented 3 months ago

Thank you for your contribution. I am grateful for your patience during code review.