Fix new Clippy lint about manual div_ceil implementation

This numeric method was added on Rust 1.73, which is below our MSRV.
This commit is contained in:
Alejandro González 2024-09-28 15:42:02 +02:00
parent 7a29741f18
commit 44619fd24d
No known key found for this signature in database

View file

@ -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