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

chore: cargo clippy fixes for 1.83.0 #196

Merged
merged 1 commit into from
Dec 14, 2024
Merged

chore: cargo clippy fixes for 1.83.0 #196

merged 1 commit into from
Dec 14, 2024

Conversation

heeckhau
Copy link
Collaborator

No description provided.

@heeckhau heeckhau mentioned this pull request Dec 12, 2024
@heeckhau heeckhau requested review from themighty1 and th4s December 12, 2024 10:22
@@ -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);
Copy link
Member

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.

Copy link
Collaborator Author

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

Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

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

same

@sinui0 sinui0 merged commit 07ed76b into dev Dec 14, 2024
3 checks passed
@sinui0 sinui0 deleted the clippy_1.83.0 branch December 14, 2024 21:02
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.

3 participants