From 9f5e9cd2e886fea74779580bc4546b10a04c66d2 Mon Sep 17 00:00:00 2001 From: Michael Sproul <michael@sigmaprime.io> Date: Fri, 26 Jul 2024 11:26:09 +1000 Subject: [PATCH] Remove detect-cpufeatures feature --- Cargo.toml | 5 ++--- src/lib.rs | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4d4c873..821b49e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ ring = "0.17" sha2 = "0.10" [target.'cfg(target_arch = "x86_64")'.dependencies] -cpufeatures = { version = "0.2", optional = true } +cpufeatures = "0.2" [dev-dependencies] rustc-hex = "2" @@ -25,6 +25,5 @@ rustc-hex = "2" wasm-bindgen-test = "0.3.33" [features] -default = ["zero_hash_cache", "detect-cpufeatures"] +default = ["zero_hash_cache"] zero_hash_cache = ["lazy_static"] -detect-cpufeatures = ["cpufeatures"] diff --git a/src/lib.rs b/src/lib.rs index 8dcbebf..20e698d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,15 +127,15 @@ pub enum DynamicImpl { // Runtime latch for detecting the availability of SHA extensions on x86_64. // // Inspired by the runtime switch within the `sha2` crate itself. -#[cfg(all(feature = "detect-cpufeatures", target_arch = "x86_64"))] +#[cfg(target_arch = "x86_64")] cpufeatures::new!(x86_sha_extensions, "sha", "sse2", "ssse3", "sse4.1"); #[inline(always)] pub fn have_sha_extensions() -> bool { - #[cfg(all(feature = "detect-cpufeatures", target_arch = "x86_64"))] + #[cfg(target_arch = "x86_64")] return x86_sha_extensions::get(); - #[cfg(not(all(feature = "detect-cpufeatures", target_arch = "x86_64")))] + #[cfg(not(target_arch = "x86_64"))] return false; }