From 4ff28d50dc138f7a136e9c179d1783f32aa28468 Mon Sep 17 00:00:00 2001 From: platlas Date: Tue, 16 Jan 2024 20:54:16 +0100 Subject: [PATCH] clippy: Fix `items_after_test_module` and `unused_enumerate_index` --- src/cubicbez.rs | 2 +- src/point.rs | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/cubicbez.rs b/src/cubicbez.rs index 3a59f8f3..1408e616 100644 --- a/src/cubicbez.rs +++ b/src/cubicbez.rs @@ -930,7 +930,7 @@ mod tests { for i in 0..10 { let accuracy = 0.1f64.powi(i); let mut worst: f64 = 0.0; - for (_count, (t0, t1, q)) in c.to_quads(accuracy).enumerate() { + for (t0, t1, q) in c.to_quads(accuracy) { let epsilon = 1e-12; assert!((q.start() - c.eval(t0)).hypot() < epsilon); assert!((q.end() - c.eval(t1)).hypot() < epsilon); diff --git a/src/point.rs b/src/point.rs index fc7732b2..84baf6c7 100644 --- a/src/point.rs +++ b/src/point.rs @@ -290,6 +290,22 @@ impl fmt::Display for Point { } } +#[cfg(feature = "mint")] +impl From for mint::Point2 { + #[inline] + fn from(p: Point) -> mint::Point2 { + mint::Point2 { x: p.x, y: p.y } + } +} + +#[cfg(feature = "mint")] +impl From> for Point { + #[inline] + fn from(p: mint::Point2) -> Point { + Point { x: p.x, y: p.y } + } +} + #[cfg(test)] mod tests { use super::*; @@ -326,19 +342,3 @@ mod tests { assert_eq!(format!("{p:.2}"), "(0.12, 9.88)"); } } - -#[cfg(feature = "mint")] -impl From for mint::Point2 { - #[inline] - fn from(p: Point) -> mint::Point2 { - mint::Point2 { x: p.x, y: p.y } - } -} - -#[cfg(feature = "mint")] -impl From> for Point { - #[inline] - fn from(p: mint::Point2) -> Point { - Point { x: p.x, y: p.y } - } -}