Skip to content

Commit

Permalink
Review fixes part 8
Browse files Browse the repository at this point in the history
  • Loading branch information
micahsnyder committed Nov 6, 2023
1 parent 3808326 commit c59d598
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 3 additions & 3 deletions libclamav_rust/src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub enum Error {
#[error("No more files to extract")]
NoMoreFiles,

#[error("Invalid FMap")]
BadMap,
#[error("Invalid FMap: {0}")]
BadMap(#[from] crate::fmap::Error),

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

let current_level = recursion_stack[recursion_level];

current_level.fmap.try_into().map_err(|_| Error::BadMap)
current_level.fmap.try_into().map_err(Error::BadMap)
}
7 changes: 0 additions & 7 deletions libclamav_rust/src/fmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ impl<'a> FMap {

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

debug!(
"need_off at {:?} len {:?} returned {:?}-byte slice",
at,
len,
slice.len()
);

Ok(slice)
}

Expand Down

0 comments on commit c59d598

Please sign in to comment.