diff --git a/src/transformation/convex_hull3/convex_hull.rs b/src/transformation/convex_hull3/convex_hull.rs index 82a71fdd..8fe2f0ad 100644 --- a/src/transformation/convex_hull3/convex_hull.rs +++ b/src/transformation/convex_hull3/convex_hull.rs @@ -358,7 +358,7 @@ fn attach_and_push_facets( continue; } - let mut furthest = usize::max_value(); + let mut furthest = usize::MAX; let mut furthest_dist = 0.0; for (i, curr_facet) in new_facets.iter_mut().enumerate() { @@ -372,8 +372,7 @@ fn attach_and_push_facets( } } - if furthest != usize::max_value() - && new_facets[furthest].can_see_point(*visible_point, points) + if furthest != usize::MAX && new_facets[furthest].can_see_point(*visible_point, points) { new_facets[furthest].add_visible_point(*visible_point, points); } @@ -387,7 +386,7 @@ fn attach_and_push_facets( let mut i = 0; while i != undecidable.len() { - let mut furthest = usize::max_value(); + let mut furthest = usize::MAX; let mut furthest_dist = 0.0; let undecidable_point = undecidable[i]; @@ -402,7 +401,7 @@ fn attach_and_push_facets( } } - if furthest != usize::max_value() { + if furthest != usize::MAX { new_facets[furthest].add_visible_point(undecidable_point, points); let _ = undecidable.swap_remove(i); } else { diff --git a/src/transformation/convex_hull3/initial_mesh.rs b/src/transformation/convex_hull3/initial_mesh.rs index 62f54b6a..32a6b454 100644 --- a/src/transformation/convex_hull3/initial_mesh.rs +++ b/src/transformation/convex_hull3/initial_mesh.rs @@ -152,7 +152,7 @@ pub fn try_get_initial_mesh( .ok_or(ConvexHullError::MissingSupportPoint)?; let mut max_area = 0.0; - let mut p3 = usize::max_value(); + let mut p3 = usize::MAX; for (i, point) in normalized_points.iter().enumerate() { let area = @@ -164,7 +164,7 @@ pub fn try_get_initial_mesh( } } - if p3 == usize::max_value() { + if p3 == usize::MAX { Err(ConvexHullError::InternalError("no triangle found.")) } else { // Build two facets with opposite normals @@ -187,7 +187,7 @@ pub fn try_get_initial_mesh( continue; } - let mut furthest = usize::max_value(); + let mut furthest = usize::MAX; let mut furthest_dist = 0.0; for (i, curr_facet) in facets.iter().enumerate() { @@ -201,7 +201,7 @@ pub fn try_get_initial_mesh( } } - if furthest != usize::max_value() { + if furthest != usize::MAX { facets[furthest].add_visible_point(point, normalized_points); } else { undecidable.push(point);