Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use rand crate re-exports when available
Re-exports from `rand` crate shall be used. Otherwise trait bounds in `Mnemonic::generate_in_with` for `rand::thread_rng` object can get unsatisfied if crate deps get ouf of sync. This commit is fixing following errors: ``` error[E0277]: the trait bound `ThreadRng: rand_core::RngCore` is not satisfied --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:292:30 | 292 | Mnemonic::generate_in_with(&mut rand::thread_rng(), language, word_count) | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::RngCore` is not implemented for `ThreadRng` | | | required by a bound introduced by this call |:: = help: the following other types implement trait `rand_core::RngCore`: ... note: required by a bound in `Mnemonic::generate_in_with` --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:266:6 | 260 | pub fn generate_in_with<R>( | ---------------- required by a bound in this associated function ... 266 | R: rand_core::RngCore + rand_core::CryptoRng, | ^^^^^^^^^^^^^^^^^^ required by this bound in `Mnemonic::generate_in_with` ``` ``` error[E0277]: the trait bound `ThreadRng: rand_core::CryptoRng` is not satisfied --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:292:30 | 292 | Mnemonic::generate_in_with(&mut rand::thread_rng(), language, word_count) | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::CryptoRng` is not implemented for `ThreadRng` | | | required by a bound introduced by this call | = help: the following other types implement trait `rand_core::CryptoRng`: ... note: required by a bound in `Mnemonic::generate_in_with` --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bip39-2.0.0/src/lib.rs:266:27 | 260 | pub fn generate_in_with<R>( | ---------------- required by a bound in this associated function ... 266 | R: rand_core::RngCore + rand_core::CryptoRng, | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `Mnemonic::generate_in_with` ``` Co-authored-by: Tobin C. Harding <[email protected]>
- Loading branch information