Skip to content

Commit

Permalink
Use core::slice instead of std::slice
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpane authored and folkertdev committed Jan 14, 2025
1 parent 348060c commit 4ca72cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zlib-rs/src/deflate/longest_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ fn longest_match_help<const SLOW: bool>(
unsafe {
if best_len < core::mem::size_of::<u64>() {
let scan_val = u64::from_ne_bytes(
std::slice::from_raw_parts(scan_start, 8).try_into().unwrap());
core::slice::from_raw_parts(scan_start, 8).try_into().unwrap());
loop {
let bs = mbase_start.wrapping_add(cur_match as usize);
let match_val = u64::from_ne_bytes(
std::slice::from_raw_parts(bs, 8).try_into().unwrap());
core::slice::from_raw_parts(bs, 8).try_into().unwrap());
let cmp = scan_val ^ match_val;
if cmp == 0 {
// The first 8 bytes all matched. Additional scanning will be needed
Expand Down

0 comments on commit 4ca72cd

Please sign in to comment.