diff --git a/base/src/types.rs b/base/src/types.rs index 07b41bc..a4c7729 100644 --- a/base/src/types.rs +++ b/base/src/types.rs @@ -445,11 +445,13 @@ impl Default for Fill { #[derive(Serialize, Deserialize, Encode, Decode, Debug, PartialEq, Eq, Clone)] #[serde(rename_all = "lowercase")] +#[derive(Default)] pub enum HorizontalAlignment { Center, CenterContinuous, Distributed, Fill, + #[default] General, Justify, Left, @@ -457,11 +459,6 @@ pub enum HorizontalAlignment { } // Note that alignment in "General" depends on type -impl Default for HorizontalAlignment { - fn default() -> Self { - Self::General - } -} impl HorizontalAlignment { fn is_default(&self) -> bool { @@ -487,7 +484,9 @@ impl Display for HorizontalAlignment { #[derive(Serialize, Deserialize, Encode, Decode, Debug, PartialEq, Eq, Clone)] #[serde(rename_all = "lowercase")] +#[derive(Default)] pub enum VerticalAlignment { + #[default] Bottom, Center, Distributed, @@ -501,12 +500,6 @@ impl VerticalAlignment { } } -impl Default for VerticalAlignment { - fn default() -> Self { - Self::Bottom - } -} - impl Display for VerticalAlignment { fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { match self {