Skip to content

Commit

Permalink
style: fix clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Aug 17, 2023
1 parent b84b0d4 commit 6fcfd8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yara-x/src/re/instr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,14 +585,14 @@ impl CodeLoc for BckCodeLoc {

fn decode_offset(slice: &[u8]) -> Offset {
let bytes: &[u8; size_of::<Offset>()] =
unsafe { mem::transmute(slice.as_ptr()) };
unsafe { &*(slice.as_ptr() as *const [u8; size_of::<Offset>()]) };

Offset::from_le_bytes(*bytes)
}

fn decode_num_alt(slice: &[u8]) -> NumAlt {
let bytes: &[u8; size_of::<NumAlt>()] =
unsafe { mem::transmute(slice.as_ptr()) };
unsafe { &*(slice.as_ptr() as *const [u8; size_of::<NumAlt>()]) };

NumAlt::from_le_bytes(*bytes)
}
Expand Down

0 comments on commit 6fcfd8a

Please sign in to comment.