Since call-sites are calling unwrap anyways, panicking seems too punitive
for our use cases.
(cherry picked from commit 7cb3b6cbe2
)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
This commit is contained in:
@@ -32,8 +32,7 @@ fn bench_weighted_shuffle_new(bencher: &mut Bencher) {
|
||||
let weights = make_weights(&mut rng);
|
||||
bencher.iter(|| {
|
||||
rng.fill(&mut seed[..]);
|
||||
let shuffle = WeightedShuffle::new(&weights).unwrap();
|
||||
shuffle
|
||||
WeightedShuffle::new("", &weights)
|
||||
.shuffle(&mut ChaChaRng::from_seed(seed))
|
||||
.collect::<Vec<_>>()
|
||||
});
|
||||
|
Reference in New Issue
Block a user