Appearance
Just add #[default]
before the default variant, alongside #[derive(Default)]
rust
#[derive(Default)]
enum FontWeight {
Light,
#[default]
Regular,
Medium,
Bold,
}
Instead of writing the full trait implementation:
rust
impl Default for FontWeight {
fn default() -> Self {
FontWeight::Regular
}
}