From 731f5aa109baacce4c1ab350538d69d4e6fd342e Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 2 Aug 2023 10:09:05 +0200 Subject: [PATCH 1/2] Improve panic message --- crates/fj-core/src/operations/join/cycle.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/join/cycle.rs b/crates/fj-core/src/operations/join/cycle.rs index 44e5bbda6..d36f1e4db 100644 --- a/crates/fj-core/src/operations/join/cycle.rs +++ b/crates/fj-core/src/operations/join/cycle.rs @@ -89,7 +89,8 @@ impl JoinCycle for Cycle { ) -> Self { assert_eq!( range.end() - range.start(), - range_other.end() - range_other.start() + range_other.end() - range_other.start(), + "Ranges have different lengths", ); let mut cycle = self.clone(); From 4298e1f5be60f770020f0586bd567635d1dad597 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 2 Aug 2023 10:10:48 +0200 Subject: [PATCH 2/2] Improve panic messages --- crates/fj-core/src/operations/join/cycle.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/fj-core/src/operations/join/cycle.rs b/crates/fj-core/src/operations/join/cycle.rs index d36f1e4db..851dd874f 100644 --- a/crates/fj-core/src/operations/join/cycle.rs +++ b/crates/fj-core/src/operations/join/cycle.rs @@ -108,14 +108,14 @@ impl JoinCycle for Cycle { let vertex_a = other .half_edge_after(half_edge_other) - .expect("Expected other cycle to contain edge") + .expect("Cycle must contain edge; just obtained edge from it") .start_vertex() .clone(); let vertex_b = half_edge_other.start_vertex().clone(); let next_edge = cycle .half_edge_after(half_edge) - .expect("Expected this cycle to contain edge"); + .expect("Cycle must contain edge; just obtained edge from it"); let this_joined = half_edge .replace_curve(half_edge_other.curve().clone())