diff --git a/path/src/stroker.rs b/path/src/stroker.rs index 6a6aa55..c865358 100644 --- a/path/src/stroker.rs +++ b/path/src/stroker.rs @@ -80,9 +80,10 @@ impl Default for Stroke { } /// Draws at the beginning and end of an open path contour. -#[derive(Copy, Clone, PartialEq, Debug)] +#[derive(Copy, Clone, Default, PartialEq, Debug)] pub enum LineCap { /// No stroke extension. + #[default] Butt, /// Adds circle. Round, @@ -90,12 +91,6 @@ pub enum LineCap { Square, } -impl Default for LineCap { - fn default() -> Self { - LineCap::Butt - } -} - /// Specifies how corners are drawn when a shape is stroked. /// /// Join affects the four corners of a stroked rectangle, and the connected segments in a @@ -108,9 +103,10 @@ impl Default for LineCap { /// The fill path constructed to describe the stroked path respects the join setting but may /// not contain the actual join. For instance, a fill path constructed with round joins does /// not necessarily include circles at each connected segment. -#[derive(Copy, Clone, PartialEq, Debug)] +#[derive(Copy, Clone, Default, PartialEq, Debug)] pub enum LineJoin { /// Extends to miter limit, then switches to bevel. + #[default] Miter, /// Extends to miter limit, then clips the corner. MiterClip, @@ -120,12 +116,6 @@ pub enum LineJoin { Bevel, } -impl Default for LineJoin { - fn default() -> Self { - LineJoin::Miter - } -} - const QUAD_RECURSIVE_LIMIT: usize = 3; // quads with extreme widths (e.g. (0,1) (1,6) (0,3) width=5e7) recurse to point of failure