From dd9b8340777aeb89f4adb8824734ec810140d7c4 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 17 Feb 2023 12:20:09 +0100 Subject: [PATCH] Consolidate duplicated code --- crates/fj-kernel/src/algorithms/intersect/surface_surface.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs b/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs index 29bc7a58c..48b37f882 100644 --- a/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs +++ b/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs @@ -28,10 +28,9 @@ impl SurfaceSurfaceIntersection { // coordinates for each surface. let planes = surfaces.map(|surface| plane_from_surface(&surface)); - let [a, b] = planes; - let (a_distance, a_normal) = a.constant_normal_form(); - let (b_distance, b_normal) = b.constant_normal_form(); + let [(a_distance, a_normal), (b_distance, b_normal)] = + planes.map(|plane| plane.constant_normal_form()); let direction = a_normal.cross(&b_normal);