diff --git a/geo/src/algorithm/interior_point.rs b/geo/src/algorithm/interior_point.rs index 16045c71b..7f34c905e 100644 --- a/geo/src/algorithm/interior_point.rs +++ b/geo/src/algorithm/interior_point.rs @@ -210,7 +210,7 @@ fn polygon_interior_point_with_segment_length( let midpoint = Point::new((start.x + end.x) / two, y_mid); segments.push((midpoint, length)); } - segments.sort_by(|a, b| b.1.partial_cmp(&a.1).unwrap_or(Ordering::Less)); + segments.sort_by(|a, b| b.1.total_cmp(&a.1)); for (midpoint, segment_length) in segments { // some pairs of consecutive points traveling east-west will bound segments inside the