diff --git a/src/lib.rs b/src/lib.rs index df0a33c..aacd8a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,7 @@ cfg_if! { mod x86; use x86 as imp; } else { - use default as imp; + use generic as imp; } } @@ -628,7 +628,7 @@ fn encode_to_slice_inner( Ok(()) } -mod default { +mod generic { use super::*; /// Default encoding function. diff --git a/src/portable_simd.rs b/src/portable_simd.rs index f80a0c8..a035684 100644 --- a/src/portable_simd.rs +++ b/src/portable_simd.rs @@ -1,4 +1,4 @@ -use crate::default; +use crate::generic; use core::simd::u8x16; use core::slice; @@ -13,7 +13,7 @@ pub(super) unsafe fn encode(input: &[u8], output: *mut u8) { let mut i = 0; let (prefix, chunks, suffix) = input.as_simd::(); - default::encode::(prefix, output); + generic::encode::(prefix, output); i += prefix.len() * 2; let hex_table = u8x16::from_array(*crate::get_chars_table::()); @@ -36,7 +36,7 @@ pub(super) unsafe fn encode(input: &[u8], output: *mut u8) { i += CHUNK_SIZE; } - default::encode::(suffix, output.add(i)); + generic::encode::(suffix, output.add(i)); } -pub(super) use default::decode; +pub(super) use generic::decode; diff --git a/src/x86.rs b/src/x86.rs index 9c76a78..480fa93 100644 --- a/src/x86.rs +++ b/src/x86.rs @@ -1,4 +1,4 @@ -use crate::default; +use crate::generic; #[cfg(target_arch = "x86")] use core::arch::x86::*; @@ -16,7 +16,7 @@ cpufeatures::new!(cpuid_ssse3, "sse2", "ssse3"); /// `output` must be a valid pointer to at least `2 * input.len()` bytes. pub(super) unsafe fn encode(input: &[u8], output: *mut u8) { if input.len() < CHUNK_SIZE || !cpuid_ssse3::get() { - return default::encode::(input, output); + return generic::encode::(input, output); } // Load table and construct masks. @@ -50,8 +50,8 @@ pub(super) unsafe fn encode(input: &[u8], output: *mut u8) { } if !input_remainder.is_empty() { - default::encode::(input_remainder, output.add(i)); + generic::encode::(input_remainder, output.add(i)); } } -pub(super) use default::decode; +pub(super) use generic::decode;