Expand description
Rule §6.2: migrate #[derive(Default)] struct *Props to
#[derive(bon::Builder)] with #[builder(default)] on optional fields.
Heuristics (matches the spec §6.2 “Mechanical” strategy):
- Target: structs whose ident ends in
Propsand carry#[derive(Default)]. - For each field whose type is
Option<...>, attach#[builder(default)]— these are always optional. - The first non-
Optionfield stays required (no#[builder(default)]) soCard { item: x }keeps working out of the box. Every other non-Optionfield gets#[builder(default)]. The developer can promote any of those back to required by deleting the attribute during review.
Structs§
- Rule
component_propsrule entry.