From 0f82a118a95dc2d4a2e2e4baa38ad7adf31fca25 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Mon, 4 Jan 2021 13:43:27 +0100 Subject: [PATCH] uint: use rand 0.7 for quickcheck feature --- uint/Cargo.toml | 4 ++-- uint/src/lib.rs | 2 +- uint/src/uint.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uint/Cargo.toml b/uint/Cargo.toml index b6bb5673d..ca650e72e 100644 --- a/uint/Cargo.toml +++ b/uint/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" byteorder = { version = "1.3.2", default-features = false } crunchy = { version = "0.2.2", default-features = false } qc = { package = "quickcheck", version = "0.9.0", optional = true } -rand = { version = "0.8.0", default-features = false, optional = true } +rand07 = { package = "rand", version = "0.7", default-features = false, optional = true } hex = { version = "0.4", default-features = false } static_assertions = "1.0.0" arbitrary = { version = "0.4", optional = true } @@ -21,7 +21,7 @@ arbitrary = { version = "0.4", optional = true } [features] default = ["std"] std = ["byteorder/std", "crunchy/std", "hex/std"] -quickcheck = ["qc", "rand"] +quickcheck = ["qc", "rand07"] [[example]] name = "modular" diff --git a/uint/src/lib.rs b/uint/src/lib.rs index 0aedc11d8..83ab957a2 100644 --- a/uint/src/lib.rs +++ b/uint/src/lib.rs @@ -27,7 +27,7 @@ pub use qc; #[cfg(feature = "quickcheck")] #[doc(hidden)] -pub use rand; +pub use rand07; #[cfg(feature = "arbitrary")] #[doc(hidden)] diff --git a/uint/src/uint.rs b/uint/src/uint.rs index e6b99e537..edf5c9e5a 100644 --- a/uint/src/uint.rs +++ b/uint/src/uint.rs @@ -1741,8 +1741,8 @@ macro_rules! impl_quickcheck_arbitrary_for_uint { fn arbitrary(g: &mut G) -> Self { let mut res = [0u8; $n_bytes]; - use $crate::rand::Rng; - let p: f64 = $crate::rand::rngs::OsRng.gen(); + use $crate::rand07::Rng; + let p: f64 = $crate::rand07::rngs::OsRng.gen(); // make it more likely to generate smaller numbers that // don't use up the full $n_bytes let range =