diff options
author | 2022-07-04 01:17:29 +0200 | |
---|---|---|
committer | 2022-07-09 17:07:38 +0200 | |
commit | 15f794b7a89efb3299cb85b392ec13af145fb0fd (patch) | |
tree | 39d8c740168e4c09e15538451ba7f3899051ad43 /graphics/src/widget | |
parent | e053e25d2ccb17f7a162685a106a8bbd915a873f (diff) | |
download | iced-15f794b7a89efb3299cb85b392ec13af145fb0fd.tar.gz iced-15f794b7a89efb3299cb85b392ec13af145fb0fd.tar.bz2 iced-15f794b7a89efb3299cb85b392ec13af145fb0fd.zip |
Address Clippy lints
Diffstat (limited to 'graphics/src/widget')
-rw-r--r-- | graphics/src/widget/canvas/path.rs | 5 | ||||
-rw-r--r-- | graphics/src/widget/canvas/path/builder.rs | 2 | ||||
-rw-r--r-- | graphics/src/widget/qr_code.rs | 5 |
3 files changed, 4 insertions, 8 deletions
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(), diff --git a/graphics/src/widget/qr_code.rs b/graphics/src/widget/qr_code.rs index 1eb862ba..86a27fd0 100644 --- a/graphics/src/widget/qr_code.rs +++ b/graphics/src/widget/qr_code.rs @@ -67,10 +67,7 @@ where let side_length = (self.state.width + 2 * QUIET_ZONE) as f32 * f32::from(self.cell_size); - layout::Node::new(Size::new( - f32::from(side_length), - f32::from(side_length), - )) + layout::Node::new(Size::new(side_length, side_length)) } fn draw( |