-
Notifications
You must be signed in to change notification settings - Fork 48
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
chore: cargo clippy fixes for 1.83.0 #196
Conversation
@@ -64,7 +64,7 @@ impl<const D: usize> LpnEncoder<D> { | |||
|
|||
#[inline] | |||
fn compute_one_row(&self, y: &mut [Block], x: &[Block], pos: usize, prp: &Prp) { | |||
let block_size = (D + 4 - 1) / 4; | |||
let block_size = D.div_ceil(4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if it is helpful here to follow clippy's advice. I suspect that this can create confusion so I would tend to suppress clippy or add a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the Clippy team made this rule with severity error
for a reason.
The docs says: It's simpler, clearer and more readable.
https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil
rust-lang/rust-clippy#12894
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion here. My thoughts were that I would probably spend a few extra brain cycles what happened to the original formula.
@@ -47,7 +47,7 @@ impl Receiver<state::PreExtension> { | |||
} | |||
|
|||
// The range of each interval. | |||
let k = (n + t - 1) / t; | |||
let k = n.div_ceil(t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -50,7 +50,7 @@ impl Sender<state::PreExtension> { | |||
} | |||
|
|||
// The range of each interval. | |||
let k = (n + t - 1) / t; | |||
let k = n.div_ceil(t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
No description provided.