diff --git a/src-tauri/core/src/area_report.rs b/src-tauri/core/src/area_report.rs index 14df9a17..b8b5dff1 100644 --- a/src-tauri/core/src/area_report.rs +++ b/src-tauri/core/src/area_report.rs @@ -536,7 +536,7 @@ mod tests { } } for (_, mut v) in rows { - v.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); + v.sort_by(|a, b| a.0.total_cmp(&b.0)); for w in v.windows(2) { assert!(w[0].1 <= w[1].0, "Überlappung {:?}", w); } diff --git a/src-tauri/core/src/plan/wall_poche.rs b/src-tauri/core/src/plan/wall_poche.rs index 62b24f1f..5cd34fb2 100644 --- a/src-tauri/core/src/plan/wall_poche.rs +++ b/src-tauri/core/src/plan/wall_poche.rs @@ -1112,7 +1112,7 @@ mod tests { }); let c = core.unwrap(); let mut ends = [c[0].x, c[3].x]; - ends.sort_by(|a, b| a.partial_cmp(b).unwrap()); + ends.sort_by(|a, b| a.total_cmp(b)); assert!((c[0].y - merge).abs() < 1e-9 && (c[3].y - merge).abs() < 1e-9, "{deg}°"); assert!((ends[0] - xb0).abs() < 1e-9 && (ends[1] - xb1).abs() < 1e-9, "{deg}° {ends:?} {xb0} {xb1}"); // Fugen beidseits des Kerns laufen bis zur Rückgrat-Fläche (Kern gegen Nah-Putz), die diff --git a/src-tauri/hatchgen/src/hatch.rs b/src-tauri/hatchgen/src/hatch.rs index a9e8dffa..d5e5bc0d 100644 --- a/src-tauri/hatchgen/src/hatch.rs +++ b/src-tauri/hatchgen/src/hatch.rs @@ -1359,7 +1359,7 @@ mod tests { ((a.y - y) * (b.y - y) <= 0.0 && (b.y - a.y).abs() > 1e-12).then(|| a.x + (y - a.y) / (b.y - a.y) * (b.x - a.x)) }) .collect(); - xs.sort_by(|a, b| a.partial_cmp(b).unwrap()); + xs.sort_by(|a, b| a.total_cmp(b)); xs } diff --git a/src-tauri/render3d/src/mesh.rs b/src-tauri/render3d/src/mesh.rs index 3ad9bf31..5c34a8a0 100644 --- a/src-tauri/render3d/src/mesh.rs +++ b/src-tauri/render3d/src/mesh.rs @@ -397,7 +397,7 @@ fn solid_subrects( holes: &[(f32, f32, f32, f32)], ) -> Vec<(f32, f32, f32, f32)> { let sort_dedup = |mut v: Vec| -> Vec { - v.sort_by(|a, b| a.partial_cmp(b).unwrap()); + v.sort_by(|a, b| a.total_cmp(b)); v.dedup_by(|a, b| (*a - *b).abs() <= MIN_SPAN); v }; @@ -444,7 +444,7 @@ fn subtract_intervals(lo: f32, hi: f32, gaps: &[(f32, f32)]) -> Vec<(f32, f32)> .map(|(a, b)| (a.max(lo), b.min(hi))) .filter(|(a, b)| b - a > MIN_SPAN) .collect(); - gs.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); + gs.sort_by(|a, b| a.0.total_cmp(&b.0)); let mut out = Vec::new(); let mut cursor = lo; for (a, b) in gs { diff --git a/src-tauri/render3d/src/openings.rs b/src-tauri/render3d/src/openings.rs index a5e03fca..eb6a23b2 100644 --- a/src-tauri/render3d/src/openings.rs +++ b/src-tauri/render3d/src/openings.rs @@ -44,7 +44,7 @@ pub(crate) fn split_range_by_voids( if voids.is_empty() { return vec![(lo, hi, z0, z1)]; } - voids.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); + voids.sort_by(|a, b| a.0.total_cmp(&b.0)); let mut rects = Vec::new(); let mut cursor = lo; diff --git a/src-tauri/render3d/src/section.rs b/src-tauri/render3d/src/section.rs index 0de7a0e2..c215bb1b 100644 --- a/src-tauri/render3d/src/section.rs +++ b/src-tauri/render3d/src/section.rs @@ -516,7 +516,7 @@ fn footprint_u_intervals(plane: &SectionPlane, footprint: &[Point2]) -> Vec<(f32 crossings.push(u_of([px, py])); } } - crossings.sort_by(|x, y| x.partial_cmp(y).unwrap()); + crossings.sort_by(|x, y| x.total_cmp(y)); crossings.dedup_by(|x, y| (*x - *y).abs() < eps); let mut out = Vec::new(); @@ -755,7 +755,7 @@ fn intersect_ranges(a: Option<(f32, f32)>, b: Option<(f32, f32)>) -> Option<(f32 /// disjunkten Liste. fn merge_intervals(mut ivs: Vec<(f32, f32)>) -> Vec<(f32, f32)> { ivs.retain(|(s, e)| *e - *s > MIN_SPAN); - ivs.sort_by(|a, b| a.0.partial_cmp(&b.0).unwrap()); + ivs.sort_by(|a, b| a.0.total_cmp(&b.0)); let mut out: Vec<(f32, f32)> = Vec::new(); for (s, e) in ivs { if let Some(last) = out.last_mut() {