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: manual_div_ceil #4438

Merged

Conversation

brooksprumo
Copy link

Problem

New clippy lints when upgrading to rust 1.84.0.

warning: manually reimplementing `div_ceil`
  --> core/benches/shredder.rs:60:22
   |
60 |     let num_shreds = ((1000 * 1000) + (shred_size - 1)) / shred_size;
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(1000 * 1000).div_ceil(shred_size)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
   = note: `#[warn(clippy::manual_div_ceil)]` on by default

Summary of Changes

Replace with div_ceil().

Similar to #4376
Partially fixes #4380

@brooksprumo brooksprumo marked this pull request as ready for review January 13, 2025 19:22
@brooksprumo
Copy link
Author

@KirillLykov Requesting your review mostly given your general knowledge with the bench-tps and friends code. This PR is to fix a clippy lint in the new rust version, so should be quite self contained.

Copy link

@KirillLykov KirillLykov left a comment

Choose a reason for hiding this comment

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

a reasonable change to me, thanks for fixing

@brooksprumo brooksprumo merged commit 91210fc into anza-xyz:master Jan 13, 2025
47 checks passed
@brooksprumo brooksprumo deleted the rust-1.84.0/clippy/manual_div_ceil branch January 13, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New clippy lints in Rust 1.84.0
2 participants