fix-clippy - #319
Merged
Merged
fix-clippy#319
Conversation
Signed-off-by: Cedric Chevalier <cedric.chevalier@cea.fr>
Signed-off-by: Cedric Chevalier <cedric.chevalier@cea.fr>
Signed-off-by: Cedric Chevalier <cedric.chevalier@cea.fr>
Signed-off-by: Cedric Chevalier <cedric.chevalier@cea.fr>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses clippy warnings that arose from a previous update (#317). The changes modernize the codebase by adopting newer Rust standard library APIs and cleaning up code quality issues.
Key changes:
- Migrates numerical constants from
std::*namespace to associated type constants (e.g.,std::f64::MAX→f64::MAX) - Replaces manual ceiling division with
div_ceil()method - Updates to use
is_multiple_of()for cleaner modulo checks - Adds explicit
unsafeblocks withinunsafefunctions for better safety documentation - Changes lookup table from
consttostaticto avoid code bloat - Updates external library API calls (rand, rayon, criterion)
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/src/bin/mesh-reorder.rs | Updates rand API from thread_rng() to rng() |
| tools/mesh-io/ffi/src/lib.rs | Assigns unused return value with explanation comment |
| src/work_share.rs | Replaces manual ceiling division with div_ceil() |
| src/topology/mod.rs | Removes unnecessary lifetime annotation via elision |
| src/nextafter.rs | Migrates floating-point constants to associated constants |
| src/geometry.rs | Migrates floating-point constants to associated constants |
| src/cartesian/mod.rs | Uses is_multiple_of() and compound assignment operator |
| src/algorithms/z_curve.rs | Migrates integer constant to associated constant |
| src/algorithms/recursive_bisection.rs | Adds explicit unsafe block within unsafe function |
| src/algorithms/multi_jagged.rs | Uses is_multiple_of() and migrates constants |
| src/algorithms/kernighan_lin.rs | Adopts let-chain syntax and migrates constants |
| src/algorithms/k_means.rs | Removes unused hilbert field from settings struct and migrates constants |
| src/algorithms/hilbert_curve.rs | Changes large lookup table from const to static |
| src/algorithms.rs | Updates rand API from gen_range() to random_range() |
| ffi/src/data.rs | Updates rayon API from repeatn() to repeat_n() |
| benches/rcb_cartesian.rs | Moves black_box import from criterion to std, removes unnecessary reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
imrn99
approved these changes
Jan 6, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cedric Chevalier <cedric.chevalier@cea.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix clippy warnings due to the previous update #317
Mainly:
stdis_multipleunsafeinteractions.