Skip to content

Commit 44619fd

Browse files
committed
Fix new Clippy lint about manual div_ceil implementation
This numeric method was added on Rust 1.73, which is below our MSRV.
1 parent 7a29741 commit 44619fd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/interlace.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,8 @@ fn deinterlace_bits(png: &PngImage) -> Vec<u8> {
118118
let mut current_y: usize = pass_constants.y_shift as usize;
119119
for line in png.scan_lines(false) {
120120
let bit_vec = line.data.view_bits::<Msb0>();
121-
let bits_in_line = ((png.ihdr.width - u32::from(pass_constants.x_shift)
122-
+ u32::from(pass_constants.x_step)
123-
- 1)
124-
/ u32::from(pass_constants.x_step)) as usize
121+
let bits_in_line = (png.ihdr.width - u32::from(pass_constants.x_shift))
122+
.div_ceil(u32::from(pass_constants.x_step)) as usize
125123
* bits_per_pixel;
126124
for (i, bit) in bit_vec.iter().by_vals().enumerate() {
127125
// Avoid moving padded 0's into new image

0 commit comments

Comments
 (0)