Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy: Fix legacy_numeric_constants lint #207

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/transformation/convex_hull3/convex_hull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
}
Expand All @@ -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];

Expand All @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions src/transformation/convex_hull3/initial_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
Expand All @@ -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() {
Expand All @@ -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);
Expand Down