From 15f794b7a89efb3299cb85b392ec13af145fb0fd Mon Sep 17 00:00:00 2001 From: Poly Date: Mon, 4 Jul 2022 01:17:29 +0200 Subject: Address Clippy lints --- graphics/src/widget/canvas/path.rs | 5 ++--- graphics/src/widget/canvas/path/builder.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'graphics/src/widget/canvas') diff --git a/graphics/src/widget/canvas/path.rs b/graphics/src/widget/canvas/path.rs index 1728f060..47786224 100644 --- a/graphics/src/widget/canvas/path.rs +++ b/graphics/src/widget/canvas/path.rs @@ -74,7 +74,7 @@ impl Path { pub(super) fn dashed(path: &Path, line_dash: LineDash<'_>) -> Path { Path::new(|builder| { let segments_odd = (line_dash.segments.len() % 2 == 1).then(|| { - [&line_dash.segments[..], &line_dash.segments[..]].concat() + [line_dash.segments, line_dash.segments].concat() }); let mut draw_line = false; @@ -103,8 +103,7 @@ pub(super) fn dashed(path: &Path, line_dash: LineDash<'_>) -> Path { }, index: line_dash.offset, intervals: segments_odd - .as_ref() - .map(Vec::as_slice) + .as_deref() .unwrap_or(line_dash.segments), }, ); diff --git a/graphics/src/widget/canvas/path/builder.rs b/graphics/src/widget/canvas/path/builder.rs index d04dbdde..2f1f85a0 100644 --- a/graphics/src/widget/canvas/path/builder.rs +++ b/graphics/src/widget/canvas/path/builder.rs @@ -53,7 +53,7 @@ impl Builder { let _ = self.raw.line_to(a); } - let _ = self.raw.arc_to( + self.raw.arc_to( math::Vector::new(radius, radius), math::Angle::radians(0.0), path::ArcFlags::default(), -- cgit From 33a24b58210c88571f789ee27495e3ee3a55e3a4 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 9 Jul 2022 17:05:45 +0200 Subject: Run `cargo fmt` --- graphics/src/widget/canvas/path.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'graphics/src/widget/canvas') diff --git a/graphics/src/widget/canvas/path.rs b/graphics/src/widget/canvas/path.rs index 47786224..f834e286 100644 --- a/graphics/src/widget/canvas/path.rs +++ b/graphics/src/widget/canvas/path.rs @@ -73,9 +73,8 @@ impl Path { pub(super) fn dashed(path: &Path, line_dash: LineDash<'_>) -> Path { Path::new(|builder| { - let segments_odd = (line_dash.segments.len() % 2 == 1).then(|| { - [line_dash.segments, line_dash.segments].concat() - }); + let segments_odd = (line_dash.segments.len() % 2 == 1) + .then(|| [line_dash.segments, line_dash.segments].concat()); let mut draw_line = false; -- cgit From 2065a40f642589134142a740ff4198deaa4c378b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 9 Jul 2022 18:42:41 +0200 Subject: Fix `clippy` lints for all crates and features ... and check those in CI as well! --- graphics/src/widget/canvas/path/builder.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'graphics/src/widget/canvas') diff --git a/graphics/src/widget/canvas/path/builder.rs b/graphics/src/widget/canvas/path/builder.rs index 2f1f85a0..05316d8a 100644 --- a/graphics/src/widget/canvas/path/builder.rs +++ b/graphics/src/widget/canvas/path/builder.rs @@ -151,3 +151,9 @@ impl Builder { } } } + +impl Default for Builder { + fn default() -> Self { + Self::new() + } +} -- cgit