Skip to content

Commit ba21f5c

Browse files
onethumbloadingalias
authored andcommitted
Add FFI back to default feature set
Gating it behind the `ffi` feature flag would be a breaking change for 3rd party applications which depend on a build-from-source workflow. Also improve docs while we’re in here.
1 parent efc5f70 commit ba21f5c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Cargo.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ bench = true
2323

2424
[dependencies]
2525
crc = "3"
26+
27+
# We use digest with default-features = false and features = ["alloc"] to enable heap allocation support in no_std environments.
28+
# This configuration is safe because the alloc feature in digest does not depend on its default features as of digest v0.10.
2629
digest = { version = "0.10", optional = true, default-features = false, features = ["alloc"] }
2730

2831
# will be removed once Rust 1.89 is the minimum supported version
@@ -72,13 +75,16 @@ harness = false
7275
required-features = ["std"]
7376

7477
[features]
75-
default = ["std", "panic-handler"]
78+
# default features
79+
default = ["std", "panic-handler", "ffi"]
7680
std = ["alloc"] # std implies alloc is available
77-
cli = ["std"]
7881
alloc = ["digest"] # marker feature for heap allocation support
79-
cache = ["alloc", "hashbrown"] # caching requires alloc + hashbrown HashMap
80-
ffi = ["std"]
8182
panic-handler = [] # Provides panic handler for no_std library checks (disable in binaries)
83+
ffi = [] # C/C++ compatible dynamic/static library, planned to become optional in the next MAJOR version (v2) to reduce overhead
84+
85+
# optional features
86+
cli = ["std"] # command line interface binaries (checksum, arch-check, get-custom-params)
87+
cache = ["alloc", "hashbrown"] # no_std caching requires alloc + hashbrown HashMap
8288

8389
# the features below are deprecated, aren't in use, and will be removed in the next MAJOR version (v2)
8490
vpclmulqdq = [] # deprecated, VPCLMULQDQ stabilized in Rust 1.89.0

0 commit comments

Comments
 (0)