From 7fea54649bcf0913b4f42434ffd7c3179b32b773 Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Fri, 18 Jun 2021 13:12:28 +0200 Subject: [PATCH] example is only for x86-64 --- examples/streaming.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/streaming.rs b/examples/streaming.rs index 5db0764b..89725392 100644 --- a/examples/streaming.rs +++ b/examples/streaming.rs @@ -1,11 +1,9 @@ -#[cfg(feature = "public_imp")] -use simdutf8::basic::imp::Utf8Validator; - #[allow(unused_imports)] use std::io::{stdin, Read, Result}; -#[cfg(feature = "public_imp")] +#[cfg(all(feature = "public_imp", target_arch = "x86_64"))] fn main() -> Result<()> { + use simdutf8::basic::imp::Utf8Validator; unsafe { if !std::is_x86_feature_detected!("avx2") { panic!("This example only works with CPUs supporting AVX 2"); @@ -32,5 +30,5 @@ fn main() -> Result<()> { } /// Dummy main. This example requires the crate feature `public_imp`. -#[cfg(not(feature = "public_imp"))] +#[cfg(not(all(feature = "public_imp", target_arch = "x86_64")))] fn main() {}