Be explicit about example feature requirements

The examples depend on having the "std" feature [1]. In preparation for
being able to run tests with `--no-default-features` add the "std"
feature as a requirement for all three examples. While we are at it use
the correct rand feature requirement: `rand-std`.

[1] Technically we only need "alloc" but "alloc" is not working with
Rust 1.29 currently so just use "std".
This commit is contained in:
Tobin Harding 2022-02-01 14:59:29 +11:00
parent 433c350424
commit a79840eca2
2 changed files with 6 additions and 5 deletions

View File

@ -49,14 +49,15 @@ rand = { version = "0.6", features = ["wasm-bindgen"] }
[[example]]
name = "sign_verify_recovery"
required-features = ["recovery"]
required-features = ["std", "recovery"]
[[example]]
name = "sign_verify"
required-features = ["std"]
[[example]]
name = "generate_keys"
required-features = ["rand"]
required-features = ["std", "rand-std"]
[workspace]
members = ["secp256k1-sys"]

View File

@ -45,9 +45,9 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then
fi
# Examples
cargo run --example sign_verify
cargo run --example sign_verify_recovery --features=recovery
cargo run --example generate_keys --features=rand
cargo run --example sign_verify --features=std
cargo run --example sign_verify_recovery --features=std,recovery
cargo run --example generate_keys --features=std,rand-std
fi
# Docs