Fix straightforward cast/borrow lints

This commit is contained in:
A. Molzer committed 2025-07-14 19:25:12 +02:00
1 parent 2942f9de97
commit ca74c03520
4 files changed
+8 -12

No files matched your search

+1 -1
View File
@@ -445,7 +445,7 @@ impl Entry {
// 2b: the value is at most 4 bytes or doesn't fit in the offset field.
return Ok(match self.type_ {
Type::BYTE => Byte(self.offset[0]),
Type::SBYTE => SignedByte(i8::from(self.offset[0] as i8)),
Type::SBYTE => SignedByte(self.offset[0] as i8),
Type::UNDEFINED => Byte(self.offset[0]),
Type::SHORT => Short(self.r(bo).read_u16()?),
Type::SSHORT => SignedShort(self.r(bo).read_i16()?),
+3 -7
View File
@@ -643,11 +643,11 @@ impl Image {
self.jpeg_tables.as_deref().map(|a| &**a),
)?;
if output_row_stride == chunk_row_bytes as usize {
if output_row_stride == chunk_row_bytes {
let tile = &mut buf[..chunk_row_bytes * data_dims.1 as usize];
reader.read_exact(tile)?;
for row in tile.chunks_mut(chunk_row_bytes as usize) {
for row in tile.chunks_mut(chunk_row_bytes) {
super::fix_endianness_and_predict(
row,
color_type.bit_depth(),
@@ -678,11 +678,7 @@ impl Image {
}
}
} else {
for (_i, row) in buf
.chunks_mut(output_row_stride)
.take(data_dims.1 as usize)
.enumerate()
{
for row in buf.chunks_mut(output_row_stride).take(data_dims.1 as usize) {
let row = &mut row[..data_row_bytes];
reader.read_exact(row)?;