oxidecomputer / amd-apcb

AMD Generic Encapsulated Software Architecture Platform Security Processor Configuration Block manipulation library
Mozilla Public License 2.0
13 stars 1 forks source link

Make make_bitfield_serde not default fields by default #91

Closed daym closed 1 year ago

daym commented 1 year ago

Right now, make_bitfield_serde defaults fields if they are missing.

But make_accessors--which is the pendant for structs that aren't bitfields-- does not default anything if a value for the respective field is missing in the json5 configuration. Instead, it's possible to specify attributes (such as #[serde(default)]) on the serde field.

make_bitfield_serde should be adapted to implement the same language and semantics in this respect that make_accessors already does.