prost icon indicating copy to clipboard operation
prost copied to clipboard

WIP: feat: derive Copy trait for messages where possible

Open caspermeijn opened this issue 7 months ago • 0 comments

Rust primitive types can be copied by simply copying the bits. Rust structs can also have this property by deriving the Copy trait.

Automatically derive Copy for:

  • messages that only have fields with primitive types
  • the Rust enum for one-of fields
  • messages whose field type are messages that also implement Copy

Generated code for Protobuf enums already derives Copy.

Other commit

fix: fq_message_name should begin with one dot

When package name is empty, but type_path is filled, the fq_message_name should begin with a single dot.

Open issues

Requires #981 to be merged first

caspermeijn avatar Nov 24 '23 15:11 caspermeijn