Skip to content

Commit d1a6caa

Browse files
committed
crc-fast-rust: fixed software fallback issue; swapped 2024->2021 - my own habits.
1 parent 0620a95 commit d1a6caa

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

examples/no_std_embedded/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "no_std_embedded_example"
33
version = "0.1.0"
4-
edition = "2024"
4+
edition = "2021"
55
publish = false
66

77
[dependencies]

src/feature_detection.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ extern crate alloc;
2222
any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
2323
))]
2424
use alloc::string::{String, ToString};
25-
#[cfg(all(
26-
feature = "std",
27-
any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
25+
#[cfg(any(
26+
test,
27+
all(
28+
feature = "std",
29+
any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
30+
)
2831
))]
2932
use std::string::{String, ToString};
3033

@@ -80,9 +83,12 @@ pub struct ArchCapabilities {
8083

8184
/// Helper function to convert a performance tier to a human-readable target string
8285
/// Format: {architecture}-{intrinsics-family}-{intrinsics-features}
83-
#[cfg(all(
84-
feature = "alloc",
85-
any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
86+
#[cfg(any(
87+
test,
88+
all(
89+
feature = "alloc",
90+
any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
91+
)
8692
))]
8793
#[inline(always)]
8894
fn tier_to_target_string(tier: PerformanceTier) -> String {

0 commit comments

Comments
 (0)