mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-27 00:50:43 +00:00
loader: use as_chunks for PE section headers (#79 follow-up)
Rust 1.100 Clippy rejects chunks_exact with a constant size (chunks_exact_to_as_chunks), which fails the pinned cargo clippy -D warnings gate on main since #250. No behavior change. Signed-off-by: Swastick Chowdhury <28708247+Swastickc@users.noreply.github.com>
This commit is contained in:
1 parent
6772205213
commit
e1317322e1
1 file changed
+4
-1
@@ -170,7 +170,10 @@ impl ParsedPe {
|
||||
}
|
||||
|
||||
let mut sections = Vec::with_capacity(usize::from(number_of_sections));
|
||||
for sec_bytes in bytes[section_table_offset..table_end].chunks_exact(SECTION_HEADER_SIZE) {
|
||||
for sec_bytes in bytes[section_table_offset..table_end]
|
||||
.as_chunks::<SECTION_HEADER_SIZE>()
|
||||
.0
|
||||
{
|
||||
// Section name (up to 8 bytes UTF-8 or null-padded ASCII)
|
||||
let name_raw = &sec_bytes[0..8];
|
||||
let name_len = name_raw.iter().position(|&b| b == 0).unwrap_or(8);
|
||||
|
||||
Reference in new issue
Block a user