Attribute Macro common_fields

Source
#[common_fields]
Expand description

Usage example:

#[common_fields({ /// Common size field for all variants #[serde(default)] pub size: u64 })] enum Test { A { } B { x: bool } }

Becomes:

enum Test { A { /// Common size field for all variants #[serde(default)] pub size: u64 } B { x: bool, /// Common size field for all variants #[serde(default)] pub size: u64 } }