1
0
Fork 0
mirror of https://github.com/azalea-rs/simdnbt.git synced 2025-08-02 07:26:04 +00:00

split_first_chunk instead of split_array_ref

This commit is contained in:
mat 2024-01-24 23:18:14 -06:00
parent ecb0c42f1f
commit d71b45ef3e
2 changed files with 3 additions and 4 deletions

View file

@ -1,7 +1,6 @@
#![doc = include_str!("../../README.md")]
#![feature(portable_simd)]
#![feature(array_chunks)]
#![feature(split_array)]
pub mod borrow;
mod common;

View file

@ -25,7 +25,7 @@ fn is_plain_ascii(slice: &[u8]) -> bool {
let mut remainder = chunks_32_exact.remainder();
if remainder.len() > 16 {
let chunk;
(chunk, remainder) = remainder.split_array_ref::<16>();
(chunk, remainder) = remainder.split_first_chunk::<16>().unwrap();
let mask = u8x16::splat(0b10000000);
let zero = u8x16::splat(0);
let simd = u8x16::from_array(*chunk);
@ -36,7 +36,7 @@ fn is_plain_ascii(slice: &[u8]) -> bool {
}
if remainder.len() > 8 {
let chunk;
(chunk, remainder) = remainder.split_array_ref::<8>();
(chunk, remainder) = remainder.split_first_chunk::<8>().unwrap();
let mask = u8x8::splat(0b10000000);
let zero = u8x8::splat(0);
let simd = u8x8::from_array(*chunk);
@ -47,7 +47,7 @@ fn is_plain_ascii(slice: &[u8]) -> bool {
}
if remainder.len() > 4 {
let chunk;
(chunk, remainder) = remainder.split_array_ref::<4>();
(chunk, remainder) = remainder.split_first_chunk::<4>().unwrap();
let mask = u8x4::splat(0b10000000);
let zero = u8x4::splat(0);
let simd = u8x4::from_array(*chunk);