Skip to content

Commit

Permalink
rand: remove rand as a public dependency
Browse files Browse the repository at this point in the history
This removes the use of the rand_core crate as a public dependency. It
is now an implementation detail.

We achieve this primarily by turning the `Gen` trait into a concrete
type and fixing the fallout.

This does make it impossible for callers to use their own `Gen`
implementations, but it's unclear how often this was being used (if at
all). This does also limit the number of RNG utility routines that
callers have easy access to. However, it should be possible to use
rand's `SeedableRng::from_{rng,seed}` routines to get access to more
general RNGs.

Closes #241
  • Loading branch information
BurntSushi committed Dec 27, 2020
1 parent b2a6ba6 commit 6df156c
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 240 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ name = "quickcheck"
[dependencies]
env_logger = { version = "0.7.0", default-features = false, optional = true }
log = { version = "0.4", optional = true }
rand = "0.7"
rand = { version = "0.7", features = ["small_rng"] }
rand_core = "0.5"
Loading

0 comments on commit 6df156c

Please sign in to comment.