From 7891a69895f36f175d95a32ecd836a1933382052 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 13 Sep 2024 20:43:54 +0200 Subject: [PATCH] Make `GenPolyline` object-safe --- crates/fj-core/src/geometry/curve.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/fj-core/src/geometry/curve.rs b/crates/fj-core/src/geometry/curve.rs index 7089903e6..cab4549c2 100644 --- a/crates/fj-core/src/geometry/curve.rs +++ b/crates/fj-core/src/geometry/curve.rs @@ -69,7 +69,7 @@ pub trait GenPolyline { fn line_segment_at( &self, point: Point<1>, - tolerance: impl Into, + tolerance: Tolerance, ) -> [Point; 2]; } @@ -81,7 +81,7 @@ impl GenPolyline for Circle { fn line_segment_at( &self, point: Point<1>, - tolerance: impl Into, + tolerance: Tolerance, ) -> [Point; 2] { let params = PathApproxParams::for_circle(self, tolerance); @@ -95,11 +95,7 @@ impl GenPolyline for Line { self.origin() } - fn line_segment_at( - &self, - point: Point<1>, - _: impl Into, - ) -> [Point; 2] { + fn line_segment_at(&self, point: Point<1>, _: Tolerance) -> [Point; 2] { // Collapse line segment into a point, as per documentation. let point = self.origin() + self.direction() * point.t; @@ -120,7 +116,7 @@ impl GenPolyline for Path { fn line_segment_at( &self, point: Point<1>, - tolerance: impl Into, + tolerance: Tolerance, ) -> [Point; 2] { match self { Self::Circle(circle) => circle.line_segment_at(point, tolerance),