From a1638400df304157a8abca0745a1a74f25576c11 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 11 Nov 2022 14:24:38 +0100 Subject: [PATCH] Remove `PartialCurve::with_path` --- crates/fj-kernel/src/algorithms/transform/curve.rs | 10 ++++++---- crates/fj-kernel/src/builder/curve.rs | 10 ++++++++-- crates/fj-kernel/src/partial/objects/curve.rs | 8 -------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/transform/curve.rs b/crates/fj-kernel/src/algorithms/transform/curve.rs index 960114022..ce81ca8d9 100644 --- a/crates/fj-kernel/src/algorithms/transform/curve.rs +++ b/crates/fj-kernel/src/algorithms/transform/curve.rs @@ -39,9 +39,11 @@ impl TransformObject for PartialCurve { // Don't need to transform `self.path`, as that's defined in surface // coordinates, and thus transforming `surface` takes care of it. - Ok(Self::default() - .with_surface(surface) - .with_path(self.path) - .with_global_form(global_form)) + Ok(PartialCurve { + path: self.path, + ..Default::default() + } + .with_surface(surface) + .with_global_form(global_form)) } } diff --git a/crates/fj-kernel/src/builder/curve.rs b/crates/fj-kernel/src/builder/curve.rs index 9135009e6..b9e93097b 100644 --- a/crates/fj-kernel/src/builder/curve.rs +++ b/crates/fj-kernel/src/builder/curve.rs @@ -36,13 +36,19 @@ impl CurveBuilder for PartialCurve { } fn update_as_circle_from_radius(self, radius: impl Into) -> Self { - self.with_path(Some(SurfacePath::circle_from_radius(radius))) + Self { + path: Some(SurfacePath::circle_from_radius(radius)), + ..self + } } fn update_as_line_from_points( self, points: [impl Into>; 2], ) -> Self { - self.with_path(Some(SurfacePath::line_from_points(points))) + Self { + path: Some(SurfacePath::line_from_points(points)), + ..self + } } } diff --git a/crates/fj-kernel/src/partial/objects/curve.rs b/crates/fj-kernel/src/partial/objects/curve.rs index 18d6ab5bf..3a6b3986b 100644 --- a/crates/fj-kernel/src/partial/objects/curve.rs +++ b/crates/fj-kernel/src/partial/objects/curve.rs @@ -22,14 +22,6 @@ pub struct PartialCurve { } impl PartialCurve { - /// Provide a path for the partial curve - pub fn with_path(mut self, path: Option) -> Self { - if let Some(path) = path { - self.path = Some(path); - } - self - } - /// Provide a surface for the partial curve pub fn with_surface(mut self, surface: Option>) -> Self { if let Some(surface) = surface {