Skip to content

Commit ad8295e

Browse files
committed
Resolve clippy lints
1 parent 65a85b1 commit ad8295e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/adam7.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Adam7Info {
4949
/// nevertheless exposed as a public API, because it helps to provide self-contained example
5050
/// usage of [`expand_interlaced_row`](crate::expand_interlaced_row).
5151
pub fn new(pass: u8, line: u32, width: u32) -> Self {
52-
assert!(1 <= pass && pass <= 7);
52+
assert!((1..=7).contains(&pass));
5353
assert!(width > 0);
5454

5555
let info = PassConstants::PASSES[pass as usize - 1];

src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl ColorType {
5353
pub(crate) fn checked_raw_row_length(self, depth: BitDepth, width: u32) -> Option<usize> {
5454
// No overflow can occur in 64 bits, we multiply 32-bit with 5 more bits.
5555
let bits = u64::from(width) * u64::from(self.samples_u8()) * u64::from(depth.into_u8());
56-
TryFrom::try_from(1 + (bits + 7) / 8).ok()
56+
TryFrom::try_from(1 + bits.div_ceil(8)).ok()
5757
}
5858

5959
pub(crate) fn raw_row_length_from_width(self, depth: BitDepth, width: u32) -> usize {

src/filter/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,9 @@ fn entropy(buf: &[u8]) -> u64 {
586586
}
587587

588588
// Consolidate the counts.
589+
//
590+
// Upstream bug: <https://github.com/rust-lang/rust-clippy/issues/11529>
591+
#[allow(clippy::needless_range_loop)]
589592
for i in 0..256 {
590593
counts[0][i] += counts[1][i] + counts[2][i] + counts[3][i];
591594
}

0 commit comments

Comments
 (0)