Skip to content

Commit

Permalink
uint: use rand 0.7 for quickcheck feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Jan 4, 2021
1 parent a29d15c commit 0f82a11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions uint/Cargo.toml
Expand Up @@ -13,15 +13,15 @@ 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 }

[features]
default = ["std"]
std = ["byteorder/std", "crunchy/std", "hex/std"]
quickcheck = ["qc", "rand"]
quickcheck = ["qc", "rand07"]

[[example]]
name = "modular"
Expand Down
2 changes: 1 addition & 1 deletion uint/src/lib.rs
Expand Up @@ -27,7 +27,7 @@ pub use qc;

#[cfg(feature = "quickcheck")]
#[doc(hidden)]
pub use rand;
pub use rand07;

#[cfg(feature = "arbitrary")]
#[doc(hidden)]
Expand Down
4 changes: 2 additions & 2 deletions uint/src/uint.rs
Expand Up @@ -1741,8 +1741,8 @@ macro_rules! impl_quickcheck_arbitrary_for_uint {
fn arbitrary<G: $crate::qc::Gen>(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 =
Expand Down

1 comment on commit 0f82a11

@dvdplm
Copy link
Contributor

@dvdplm dvdplm commented on 0f82a11 Jan 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this. We'll have to undo it when quickcheck 1.0 is released but that's fine.

Please sign in to comment.