From 03606366f855a7f74805f08572a7215f38cdb126 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 21 Dec 2023 20:40:28 +0100 Subject: [PATCH] Convert tuple enum variant into struct variant --- crates/fj-core/src/validate/shell.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/crates/fj-core/src/validate/shell.rs b/crates/fj-core/src/validate/shell.rs index 622413a89..a2ec1ca8c 100644 --- a/crates/fj-core/src/validate/shell.rs +++ b/crates/fj-core/src/validate/shell.rs @@ -47,10 +47,16 @@ pub enum ShellValidationError { #[error( "`Shell` contains `HalfEdge`s that are coincident but are not \ siblings\n\ - Half-edge 1: {0:#?}\n\ - Half-edge 2: {1:#?}" + Half-edge 1: {half_edge_a:#?}\n\ + Half-edge 2: {half_edge_b:#?}" )] - CoincidentHalfEdgesAreNotSiblings(Handle, Handle), + CoincidentHalfEdgesAreNotSiblings { + /// The first half-edge + half_edge_a: Handle, + + /// The second half-edge + half_edge_b: Handle, + }, } impl ShellValidationError { @@ -226,10 +232,10 @@ impl ShellValidationError { .all(|d| d < config.distinct_min_distance) { errors.push( - Self::CoincidentHalfEdgesAreNotSiblings( - half_edge_a.clone(), - half_edge_b.clone(), - ) + Self::CoincidentHalfEdgesAreNotSiblings { + half_edge_a: half_edge_a.clone(), + half_edge_b: half_edge_b.clone(), + } .into(), ) } @@ -395,7 +401,7 @@ mod tests { assert_contains_err!( invalid, ValidationError::Shell( - ShellValidationError::CoincidentHalfEdgesAreNotSiblings(..) + ShellValidationError::CoincidentHalfEdgesAreNotSiblings { .. } ) );