Skip to content

fix-clippy - #319

Merged
cedricchevalier19 merged 6 commits into
masterfrom
fix-clippy
Jan 6, 2026
Merged

cedricchevalier19 merged 6 commits into
masterfrom
fix-clippy

Conversation

@cedricchevalier19

@cedricchevalier19 cedricchevalier19 commented Jan 6, 2026

Copy link
Copy Markdown
Member

Fix clippy warnings due to the previous update #317

Mainly:

  • numerical constants are now on the type and not in std
  • nice shortcut for is_multiple
  • cleaning up unsafe interactions.

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>
@cedricchevalier19 cedricchevalier19 added the enhancement New feature or request label Jan 6, 2026
Signed-off-by: Cedric Chevalier <cedric.chevalier@cea.fr>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::MAXf64::MAX)
  • Replaces manual ceiling division with div_ceil() method
  • Updates to use is_multiple_of() for cleaner modulo checks
  • Adds explicit unsafe blocks within unsafe functions for better safety documentation
  • Changes lookup table from const to static to 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.

Comment thread src/algorithms/k_means.rs Outdated
Comment thread src/algorithms.rs
Comment thread ffi/src/data.rs

@imrn99 imrn99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread src/algorithms/kernighan_lin.rs
Comment thread src/algorithms/recursive_bisection.rs
cedricchevalier19 and others added 2 commits January 6, 2026 17:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Cedric Chevalier <cedric.chevalier@cea.fr>
@cedricchevalier19
cedricchevalier19 merged commit 0d8a9d8 into master Jan 6, 2026
4 checks passed
@cedricchevalier19
cedricchevalier19 deleted the fix-clippy branch January 6, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants