coreos / ignition-config-rs

Data structures for reading/writing Ignition configs
https://crates.io/crates/ignition-config
Apache License 2.0
3 stars 5 forks source link

Generate `new()` functions for structs with non-`Option` fields; implement `Default` for `Config` #16

Closed bgilbert closed 2 years ago

bgilbert commented 2 years ago

Schemafy derives Default for structs where all fields are Option. For other structs, improve ergonomics by adding a new() function that takes the required fields as arguments and sets everything else to None.

Also hand-implement Default for Config. This avoids the need to use the awkward autogenerated Config::new() functions, and automatically sets ignition.version.