From 8e8ff9484924a1bfabd78b8aa48248f3b3695b60 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 7 Oct 2022 14:03:50 +0200 Subject: [PATCH] Clean up `as_line_segment_from_points` --- crates/fj-kernel/src/partial/objects/edge.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/fj-kernel/src/partial/objects/edge.rs b/crates/fj-kernel/src/partial/objects/edge.rs index 768cfbec1..b21c94ebd 100644 --- a/crates/fj-kernel/src/partial/objects/edge.rs +++ b/crates/fj-kernel/src/partial/objects/edge.rs @@ -104,14 +104,14 @@ impl PartialHalfEdge { points: [impl Into>; 2], ) -> Self { let surface = self.surface.clone(); - self.with_vertices(Some(points.map(|point| { - Vertex::partial().with_surface_form(Some( - SurfaceVertex::partial() - .with_surface(surface.clone()) - .with_position(Some(point)), - )) - }))) - .as_line_segment() + let vertices = points.map(|point| { + let surface_form = SurfaceVertex::partial() + .with_surface(surface.clone()) + .with_position(Some(point)); + Vertex::partial().with_surface_form(Some(surface_form)) + }); + + self.with_vertices(Some(vertices)).as_line_segment() } /// Update partial half-edge as a line segment, reusing existing vertices