updating rand (#582)

This commit is contained in:
Paul Masurel
2019-06-29 13:11:42 +09:00
committed by GitHub
parent 73d7791479
commit 185a5b8d31
2 changed files with 2 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ chrono = "0.4"
winapi = "0.3"
[dev-dependencies]
rand = "0.6"
rand = "0.7"
maplit = "1"
matches = "0.1.8"
time = "0.1.42"

View File

@@ -342,7 +342,7 @@ mod tests {
pub fn sample_with_seed(n: u32, ratio: f64, seed_val: u8) -> Vec<u32> {
StdRng::from_seed([seed_val; 32])
.sample_iter(&Bernoulli::new(ratio))
.sample_iter(&Bernoulli::new(ratio).unwrap())
.take(n as usize)
.enumerate()
.filter_map(|(val, keep)| if keep { Some(val as u32) } else { None })