From 0dfa68302a4e73dc3be018f71e71c737e340ad96 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 26 Aug 2022 14:11:37 +0200 Subject: [PATCH] Remove `From` implementation It will be difficult to keep it around, due to changes I'm working on. --- crates/fj-kernel/src/algorithms/approx/curve.rs | 10 ---------- crates/fj-kernel/src/algorithms/approx/edge.rs | 6 ++++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/approx/curve.rs b/crates/fj-kernel/src/algorithms/approx/curve.rs index 6d6d7dfb8..33a99aa19 100644 --- a/crates/fj-kernel/src/algorithms/approx/curve.rs +++ b/crates/fj-kernel/src/algorithms/approx/curve.rs @@ -108,16 +108,6 @@ impl RangeOnCurve { } } -impl

From<[P; 2]> for RangeOnCurve -where - P: Into>, -{ - fn from(points: [P; 2]) -> Self { - let boundary = points.map(Into::into); - Self { boundary } - } -} - #[cfg(test)] mod tests { use fj_math::Scalar; diff --git a/crates/fj-kernel/src/algorithms/approx/edge.rs b/crates/fj-kernel/src/algorithms/approx/edge.rs index 5e3bdd792..f49132bcc 100644 --- a/crates/fj-kernel/src/algorithms/approx/edge.rs +++ b/crates/fj-kernel/src/algorithms/approx/edge.rs @@ -2,7 +2,7 @@ use fj_math::{Point, Scalar}; use crate::objects::{Edge, Vertex, VerticesOfEdge}; -use super::Approx; +use super::{curve::RangeOnCurve, Approx}; impl Approx for Edge { type Approximation = Vec<(Point<1>, Point<3>)>; @@ -16,7 +16,9 @@ impl Approx for Edge { let mut points = self.curve().approx( tolerance, // The range is only used for circles right now. - [[Scalar::ZERO], [Scalar::TAU]].into(), + RangeOnCurve { + boundary: [[Scalar::ZERO].into(), [Scalar::TAU].into()], + }, ); approx_edge(*self.vertices(), &mut points);