Fix new annoyingly pedantic clippy warnings
This commit is contained in:
parent
0ff1049eb7
commit
a234c39e41
2 changed files with 6 additions and 16 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
|
@ -265,15 +265,6 @@ version = "0.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c397ca3ea05ad509c4ec451fea28b4771236a376ca1c69fd5143aae0cf8f93c4"
|
checksum = "c397ca3ea05ad509c4ec451fea28b4771236a376ca1c69fd5143aae0cf8f93c4"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "itertools"
|
|
||||||
version = "0.10.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
|
||||||
dependencies = [
|
|
||||||
"either",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.139"
|
version = "0.2.139"
|
||||||
|
|
@ -387,7 +378,6 @@ dependencies = [
|
||||||
"filetime",
|
"filetime",
|
||||||
"image",
|
"image",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"itertools",
|
|
||||||
"libdeflater",
|
"libdeflater",
|
||||||
"log",
|
"log",
|
||||||
"rayon",
|
"rayon",
|
||||||
|
|
|
||||||
|
|
@ -158,16 +158,16 @@ fn palette_map_to_byte_map(png: &PngImage, palette_map: &[Option<u8>; 256]) -> O
|
||||||
}
|
}
|
||||||
BitDepth::Four => {
|
BitDepth::Four => {
|
||||||
for byte in 0..=255usize {
|
for byte in 0..=255usize {
|
||||||
byte_map[byte] = palette_map[(byte & 0x0F)].unwrap_or(0)
|
byte_map[byte] = palette_map[byte & 0x0F].unwrap_or(0)
|
||||||
| (palette_map[(byte >> 4)].unwrap_or(0) << 4);
|
| (palette_map[byte >> 4].unwrap_or(0) << 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BitDepth::Two => {
|
BitDepth::Two => {
|
||||||
for byte in 0..=255usize {
|
for byte in 0..=255usize {
|
||||||
byte_map[byte] = palette_map[(byte & 0x03)].unwrap_or(0)
|
byte_map[byte] = palette_map[byte & 0x03].unwrap_or(0)
|
||||||
| (palette_map[((byte >> 2) & 0x03)].unwrap_or(0) << 2)
|
| (palette_map[(byte >> 2) & 0x03].unwrap_or(0) << 2)
|
||||||
| (palette_map[((byte >> 4) & 0x03)].unwrap_or(0) << 4)
|
| (palette_map[(byte >> 4) & 0x03].unwrap_or(0) << 4)
|
||||||
| (palette_map[(byte >> 6)].unwrap_or(0) << 6);
|
| (palette_map[byte >> 6].unwrap_or(0) << 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue