Skip to content

Commit

Permalink
Upgrade to rand 0.4.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
AltSysrq committed Jan 15, 2018
1 parent 7ad5761 commit 54ebf9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
you've written your own strategy types or if you've used
`TestCaseError::Reject` or `TestCaseError::Fail` explicitly.

- Update of externally-visible crate `rand` to `0.4.2`.

### New Additions

- Added `proptest::test_runner::Reason` which allows you to avoid heap
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ unstable = []
[dependencies]
bit-set = "0.4.0"
quick-error = "1.2.1"
rand = "0.3.18"
rand = "0.4.2"
regex-syntax = "0.4.1"
lazy_static = "0.2.8"

Expand Down
5 changes: 4 additions & 1 deletion src/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ impl<T : BitSetLike> Strategy for SampledBitSetStrategy<T> {
fn new_value(&self, runner: &mut TestRunner) -> NewTree<Self> {
let mut bits = T::new_bitset(self.bits.end);
let count = runner.rng().gen_range(self.size.start, self.size.end);
for bit in rand::sample(runner.rng(), self.bits.clone(), count) {
for bit in
rand::seq::sample_iter(runner.rng(), self.bits.clone(), count)
.expect("not enough bits to sample")
{
bits.set(bit);
}

Expand Down

0 comments on commit 54ebf9e

Please sign in to comment.