Skip to content

Commit 25f2064

Browse files
authored
cryptography: add std feature (#317)
Adds an off-by-default `std` feature which activates the `std` features of all of the other dependencies. This is a somewhat lousy way of doing this, and I wish that there were a better approach, so much that I posted a Pre-Pre-RFC about it: https://internals.rust-lang.org/t/pre-pre-rfc-weak-cargo-feature-activation/13141 For now though, this is immediately useful to me.
1 parent 3182f68 commit 25f2064

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.github/workflows/cryptography.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ jobs:
3535
toolchain: ${{ matrix.rust }}
3636
target: ${{ matrix.target }}
3737
override: true
38-
- run: cargo build --release --target ${{ matrix.target }}
39-
- run: cargo build --all-features --release --target ${{ matrix.target }}
38+
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
39+
- run: cargo build --no-default-features --release --target ${{ matrix.target }}
40+
--features aead,block-cipher,mac,digest,elliptic-curve,signature,stream-cipher,universal-hash
4041
test:
4142
runs-on: ubuntu-latest
4243
strategy:

cryptography/Cargo.toml

+12
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,17 @@ signature = { version = "1.2.0", optional = true, default-features = false, path
2121
stream-cipher = { version = "0.7", optional = true, path = "../stream-cipher" }
2222
universal-hash = { version = "0.4", optional = true, path = "../universal-hash" }
2323

24+
[features]
25+
std = [
26+
"aead/std",
27+
"block-cipher/std",
28+
"digest/std",
29+
"elliptic-curve/std",
30+
"mac/std",
31+
"signature/std",
32+
"stream-cipher/std",
33+
"universal-hash/std"
34+
]
35+
2436
[package.metadata.docs.rs]
2537
all-features = true

0 commit comments

Comments
 (0)