Skip to content

Commit c59d598

Browse files
committed
Review fixes part 8
1 parent 3808326 commit c59d598

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

libclamav_rust/src/ctx.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ pub enum Error {
3939
#[error("No more files to extract")]
4040
NoMoreFiles,
4141

42-
#[error("Invalid FMap")]
43-
BadMap,
42+
#[error("Invalid FMap: {0}")]
43+
BadMap(#[from] crate::fmap::Error),
4444

4545
#[error("String not UTF8: {0}")]
4646
Utf8(#[from] std::str::Utf8Error),
@@ -94,5 +94,5 @@ pub unsafe fn current_fmap(ctx: *mut cli_ctx) -> Result<FMap, Error> {
9494

9595
let current_level = recursion_stack[recursion_level];
9696

97-
current_level.fmap.try_into().map_err(|_| Error::BadMap)
97+
current_level.fmap.try_into().map_err(Error::BadMap)
9898
}

libclamav_rust/src/fmap.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,6 @@ impl<'a> FMap {
8484

8585
let slice: &[u8] = unsafe { std::slice::from_raw_parts(ptr, len) };
8686

87-
debug!(
88-
"need_off at {:?} len {:?} returned {:?}-byte slice",
89-
at,
90-
len,
91-
slice.len()
92-
);
93-
9487
Ok(slice)
9588
}
9689

0 commit comments

Comments
 (0)