Skip to content

Commit

Permalink
Fix new Clippy lint about manual div_ceil implementation
Browse files Browse the repository at this point in the history
This numeric method was added on Rust 1.73, which is below our MSRV.
  • Loading branch information
AlexTMjugador committed Sep 28, 2024
1 parent 7a29741 commit 44619fd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/interlace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,8 @@ fn deinterlace_bits(png: &PngImage) -> Vec<u8> {
let mut current_y: usize = pass_constants.y_shift as usize;
for line in png.scan_lines(false) {
let bit_vec = line.data.view_bits::<Msb0>();
let bits_in_line = ((png.ihdr.width - u32::from(pass_constants.x_shift)
+ u32::from(pass_constants.x_step)
- 1)
/ u32::from(pass_constants.x_step)) as usize
let bits_in_line = (png.ihdr.width - u32::from(pass_constants.x_shift))
.div_ceil(u32::from(pass_constants.x_step)) as usize
* bits_per_pixel;
for (i, bit) in bit_vec.iter().by_vals().enumerate() {
// Avoid moving padded 0's into new image
Expand Down

0 comments on commit 44619fd

Please sign in to comment.