fn check_chars_dispatcher(s: &str) -> bool {
    #[cfg(target_arch = "x86_64")]
    {
        if is_x86_feature_detected!("avx2") {
            unsafe {
                CHECK_CHARS = avx::check_all_chars_are_valid;
                return avx::check_all_chars_are_valid(s);
            }
        }
        if is_x86_feature_detected!("sse4.2") {
            unsafe {
                CHECK_CHARS = sse42::check_all_chars_are_valid;
                return sse42::check_all_chars_are_valid(s);
            }
        }
        if is_x86_feature_detected!("sse4.1") {
            unsafe {
                CHECK_CHARS = sse41::check_all_chars_are_valid;
                return sse41::check_all_chars_are_valid(s);
            }
        }
    }
    // fallback implementation
    unsafe {
        CHECK_CHARS = fallback::check_all_chars_are_valid;
    }
    fallback::check_all_chars_are_valid(s)
}
/// Implements a single dispatch method to assign the appropiate function to the
/// global variable CHECK_CHARS
Implements a single dispatch method to assign the appropiate function to the
global variable CHECK_CHARS
Implements a single dispatch method to assign the appropiate function to the global variable CHECK_CHARS
fn check_chars_dispatcher(s: &str) -> bool {
    #[cfg(target_arch = "x86_64")]
    {
        if is_x86_feature_detected!("avx2") {
            unsafe {
                CHECK_CHARS = avx::check_all_chars_are_valid;
                return avx::check_all_chars_are_valid(s);
            }
        }
        if is_x86_feature_detected!("sse4.2") {
            unsafe {
                CHECK_CHARS = sse42::check_all_chars_are_valid;
                return sse42::check_all_chars_are_valid(s);
            }
        }
        if is_x86_feature_detected!("sse4.1") {
            unsafe {
                CHECK_CHARS = sse41::check_all_chars_are_valid;
                return sse41::check_all_chars_are_valid(s);
            }
        }
    }
    // fallback implementation
    unsafe {
        CHECK_CHARS = fallback::check_all_chars_are_valid;
    }
    fallback::check_all_chars_are_valid(s)
}
fn check_chars_dispatcher ( s : & str ) -> bool { # [ cfg ( target_arch " " ) ] { if is_x86_feature_detected ! ( " " ) { unsafe { CHECK_CHARS = avx :: check_all_chars_are_valid ; return avx :: check_all_chars_are_valid ( s ) ; } } if is_x86_feature_detected ! ( " " ) { unsafe { CHECK_CHARS = sse42 :: check_all_chars_are_valid ; return sse42 :: check_all_chars_are_valid ( s ) ; } } if is_x86_feature_detected ! ( " " ) { unsafe { CHECK_CHARS = sse41 :: check_all_chars_are_valid ; return sse41 :: check_all_chars_are_valid ( s ) ; } } } // fallback implementation unsafe { CHECK_CHARS = fallback :: check_all_chars_are_valid ; } fallback :: check_all_chars_are_valid ( s ) }
Implements a single dispatch method to assign the appropiate function to the
global variable CHECK_CHARS
Implements a single dispatch method to assign the appropiate function to the global variable CHECK_CHARS
s
&str