Skip to content

Commit

Permalink
Fix example dependency list
Browse files Browse the repository at this point in the history
Example relies on `rand-std` not plain `rand` dependency.

I do not understand why the following command passes without this patch
applied

```
cargo test --no-default-features --features=std,rand,bitcoin_hashes
```

But if we put the same code in a standalone binary it fails as expected?

Since the running of this test is _unusual_ and it is primarily meant as
an entry point example to the library, remove the mention of "alloc"
feature and just depend upon "std".
  • Loading branch information
tcharding committed Feb 9, 2022
1 parent ecb6261 commit 3c9dd2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
//! trigger any assertion failures in the upstream library.
//!
//! ```rust
//! # #[cfg(all(feature="rand", feature="bitcoin_hashes", any(feature = "alloc", feature = "std")))] {
//! # #[cfg(all(feature = "std", feature="rand-std", feature="bitcoin_hashes"))] {
//! use secp256k1::rand::rngs::OsRng;
//! use secp256k1::{Secp256k1, Message};
//! use secp256k1::hashes::sha256;
Expand Down

0 comments on commit 3c9dd2f

Please sign in to comment.