diff --git a/crates/fj-kernel/src/algorithms/transform/edge.rs b/crates/fj-kernel/src/algorithms/transform/edge.rs index 71c72a8d1..9ff8ca2ac 100644 --- a/crates/fj-kernel/src/algorithms/transform/edge.rs +++ b/crates/fj-kernel/src/algorithms/transform/edge.rs @@ -36,7 +36,7 @@ impl TransformObject for PartialHalfEdge { .into(); Ok(Self::default() - .with_curve(Some(curve)) + .with_curve(curve) .with_vertices(Some(vertices)) .with_global_form(global_form)) } diff --git a/crates/fj-kernel/src/builder/cycle.rs b/crates/fj-kernel/src/builder/cycle.rs index afca811b6..e123c457b 100644 --- a/crates/fj-kernel/src/builder/cycle.rs +++ b/crates/fj-kernel/src/builder/cycle.rs @@ -81,7 +81,7 @@ impl CycleBuilder for PartialCycle { half_edges.push( HalfEdge::partial() - .with_curve(Some(curve)) + .with_curve(curve) .with_vertices(Some([from, to])), ); diff --git a/crates/fj-kernel/src/builder/edge.rs b/crates/fj-kernel/src/builder/edge.rs index e3ab4d1d0..8fd977874 100644 --- a/crates/fj-kernel/src/builder/edge.rs +++ b/crates/fj-kernel/src/builder/edge.rs @@ -79,9 +79,7 @@ impl HalfEdgeBuilder for PartialHalfEdge { .with_surface_form(surface_vertex.clone()) }); - Ok(self - .with_curve(Some(curve)) - .with_vertices(Some([back, front]))) + Ok(self.with_curve(curve).with_vertices(Some([back, front]))) } fn update_as_line_segment_from_points( @@ -181,8 +179,7 @@ impl HalfEdgeBuilder for PartialHalfEdge { }) }; - self.with_curve(Some(curve)) - .with_vertices(Some([back, front])) + self.with_curve(curve).with_vertices(Some([back, front])) } } diff --git a/crates/fj-kernel/src/builder/shell.rs b/crates/fj-kernel/src/builder/shell.rs index 4ae6ef6c8..98c593442 100644 --- a/crates/fj-kernel/src/builder/shell.rs +++ b/crates/fj-kernel/src/builder/shell.rs @@ -148,7 +148,7 @@ impl<'a> ShellBuilder<'a> { )); HalfEdge::partial() - .with_curve(Some(curve)) + .with_curve(curve) .with_vertices(Some([ Vertex::partial().with_surface_form(from), Vertex::partial().with_surface_form(to), diff --git a/crates/fj-kernel/src/partial/objects/edge.rs b/crates/fj-kernel/src/partial/objects/edge.rs index e9704695f..26ece8472 100644 --- a/crates/fj-kernel/src/partial/objects/edge.rs +++ b/crates/fj-kernel/src/partial/objects/edge.rs @@ -67,13 +67,9 @@ impl PartialHalfEdge { } /// Update the partial half-edge with the given curve - pub fn with_curve( - mut self, - curve: Option>>, - ) -> Self { - if let Some(curve) = curve { - self.curve = curve.into(); - } + pub fn with_curve(mut self, curve: impl Into>) -> Self { + self.curve = curve.into(); + self }