diff --git a/parley/src/layout/data.rs b/parley/src/layout/data.rs index 74ae036a..50ffb400 100644 --- a/parley/src/layout/data.rs +++ b/parley/src/layout/data.rs @@ -82,20 +82,15 @@ pub struct RunData { pub advance: f32, } -#[derive(Copy, Clone, PartialEq)] +#[derive(Copy, Clone, Default, PartialEq)] pub enum BreakReason { + #[default] None, Regular, Explicit, Emergency, } -impl Default for BreakReason { - fn default() -> Self { - Self::None - } -} - #[derive(Clone, Default)] pub struct LineData { /// Range of the source text. diff --git a/parley/src/layout/mod.rs b/parley/src/layout/mod.rs index 633b8835..d868f995 100644 --- a/parley/src/layout/mod.rs +++ b/parley/src/layout/mod.rs @@ -27,21 +27,16 @@ pub use line::{GlyphRun, LineMetrics, PositionedInlineBox, PositionedLayoutItem} pub use run::RunMetrics; /// Alignment of a layout. -#[derive(Copy, Clone, PartialEq, Eq, Debug)] +#[derive(Copy, Clone, Default, PartialEq, Eq, Debug)] #[repr(u8)] pub enum Alignment { + #[default] Start, Middle, End, Justified, } -impl Default for Alignment { - fn default() -> Self { - Self::Start - } -} - /// Text layout. #[derive(Clone)] pub struct Layout {