Skip to content

Commit 34ed09a

Browse files
Copilotdoublegate
andcommitted
fix: address formatting and clippy linting issues
- Fix format! macro line wrapping for long error message - Replace vec! allocation with array slice for padding bytes - Adjust comment alignment to satisfy rustfmt Both cargo fmt --check and cargo clippy --workspace --all-targets now pass. Co-authored-by: doublegate <6858123+doublegate@users.noreply.github.com>
1 parent 0fbf687 commit 34ed09a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/prtip-scanner/src/output/mmap_reader.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ impl MmapResultReader {
4545
if version != 2 {
4646
return Err(io::Error::new(
4747
io::ErrorKind::InvalidData,
48-
format!("Unsupported version: {}. Expected version 2 (rkyv format).", version),
48+
format!(
49+
"Unsupported version: {}. Expected version 2 (rkyv format).",
50+
version
51+
),
4952
));
5053
}
5154

@@ -270,11 +273,10 @@ mod tests {
270273
// Write a version 1 header
271274
file.write_all(&1u64.to_le_bytes()).unwrap(); // version = 1
272275
file.write_all(&0u64.to_le_bytes()).unwrap(); // entry_count = 0
273-
file.write_all(&(ENTRY_SIZE as u64).to_le_bytes())
274-
.unwrap(); // entry_size
276+
file.write_all(&(ENTRY_SIZE as u64).to_le_bytes()).unwrap(); // entry_size
275277
file.write_all(&0u64.to_le_bytes()).unwrap(); // checksum
276-
// Pad to HEADER_SIZE
277-
file.write_all(&vec![0u8; HEADER_SIZE - 32]).unwrap();
278+
// Pad to HEADER_SIZE
279+
file.write_all(&[0u8; HEADER_SIZE - 32]).unwrap();
278280
}
279281

280282
// Attempt to open should fail with clear error message

0 commit comments

Comments
 (0)