From 016488ae373879f2cf09e3757d517fde0d9df887 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 17 May 2024 14:03:56 +0200 Subject: [PATCH] Refactor to simplify --- crates/fj-core/src/validate/shell.rs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 1b0617ac1..400d9c68b 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -96,7 +96,6 @@ impl ShellValidationError { continue; } - let mut mismatches = Vec::new(); let surface_a = geometry.of_surface(surface_a); let surface_b = geometry.of_surface(surface_b); @@ -126,22 +125,21 @@ impl ShellValidationError { let distance = (a_global - b_global).magnitude(); if distance > config.identical_max_distance { - mismatches.push(CurveGeometryMismatch { - half_edge_a: edge_a.clone(), - half_edge_b: edge_b.clone(), - point_curve, - point_a: a_global, - point_b: b_global, - distance, - }); + errors.push( + Self::CurveCoordinateSystemMismatch( + CurveGeometryMismatch { + half_edge_a: edge_a.clone(), + half_edge_b: edge_b.clone(), + point_curve, + point_a: a_global, + point_b: b_global, + distance, + }, + ) + .into(), + ); } } - - for mismatch in mismatches { - errors.push( - Self::CurveCoordinateSystemMismatch(mismatch).into(), - ); - } } } }