From 1816c985fad2ead8dc1e7b62dc8e4bafeed856b2 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 14 Mar 2023 11:11:17 +0100 Subject: Fix `clippy` lints for Rust 1.68 --- graphics/src/widget/canvas/stroke.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'graphics/src/widget/canvas/stroke.rs') diff --git a/graphics/src/widget/canvas/stroke.rs b/graphics/src/widget/canvas/stroke.rs index 4c19251d..49f5701c 100644 --- a/graphics/src/widget/canvas/stroke.rs +++ b/graphics/src/widget/canvas/stroke.rs @@ -59,9 +59,10 @@ impl<'a> Default for Stroke<'a> { } /// The shape used at the end of open subpaths when they are stroked. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Default)] pub enum LineCap { /// The stroke for each sub-path does not extend beyond its two endpoints. + #[default] Butt, /// At the end of each sub-path, the shape representing the stroke will be /// extended by a square. @@ -71,12 +72,6 @@ pub enum LineCap { Round, } -impl Default for LineCap { - fn default() -> LineCap { - LineCap::Butt - } -} - impl From for lyon::tessellation::LineCap { fn from(line_cap: LineCap) -> lyon::tessellation::LineCap { match line_cap { @@ -89,9 +84,10 @@ impl From for lyon::tessellation::LineCap { /// The shape used at the corners of paths or basic shapes when they are /// stroked. -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, Default)] pub enum LineJoin { /// A sharp corner. + #[default] Miter, /// A round corner. Round, @@ -99,12 +95,6 @@ pub enum LineJoin { Bevel, } -impl Default for LineJoin { - fn default() -> LineJoin { - LineJoin::Miter - } -} - impl From for lyon::tessellation::LineJoin { fn from(line_join: LineJoin) -> lyon::tessellation::LineJoin { match line_join { -- cgit