Skip to content

Commit 67fdd80

Browse files
authored
Merge pull request #31 from rust-random/push-usqruvwtnkuk
Update rand version and prepare 0.6.0-rc.0
2 parents d2146ee + 940cbe6 commit 67fdd80

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rand_distr"
3-
version = "0.5.1"
3+
version = "0.6.0-rc.0"
44
authors = ["The Rand Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"
@@ -33,15 +33,15 @@ std_math = ["num-traits/std"]
3333
serde = ["dep:serde", "dep:serde_with", "rand/serde"]
3434

3535
[dependencies]
36-
rand = { version = "0.9.0", default-features = false }
36+
rand = { version = "0.10.0-rc.0", default-features = false }
3737
num-traits = { version = "0.2", default-features = false, features = ["libm"] }
3838
serde = { version = "1.0.103", features = ["derive"], optional = true }
3939
serde_with = { version = "3", optional = true }
4040

4141
[dev-dependencies]
4242
rand_pcg = { version = "0.9.0" }
4343
# For inline examples
44-
rand = { version = "0.9.0", features = ["small_rng"] }
44+
rand = { version = "0.10.0-rc.0", features = ["small_rng"] }
4545
# Histogram implementation for testing uniformity
4646
average = { version = "0.16", features = [ "std" ] }
4747
# Special functions for testing distributions

benches/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ publish = false
77
[dependencies]
88

99
[dev-dependencies]
10-
rand = { version = "0.9.0", features = ["small_rng", "nightly"] }
10+
rand = { version = "0.10.0-rc.0", features = ["small_rng", "nightly"] }
1111
rand_pcg = "0.9.0"
1212
rand_distr = { path = ".." }
1313
criterion = "0.5"

distr_test/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ edition = "2024"
55
publish = false
66

77
[dev-dependencies]
8-
rand_distr = { path = "..", version = "0.5.1", default-features = false, features = ["alloc"] }
9-
rand = { version = "0.9.0", features = ["small_rng"] }
8+
rand_distr = { path = "..", default-features = false, features = ["alloc"] }
9+
rand = { version = "0.10.0-rc.0", features = ["small_rng"] }
1010
num-traits = "0.2.19"
1111
# Special functions for testing distributions
1212
special = "0.11.0"

distr_test/tests/weighted.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ fn choose_weighted_indexed() {
9696
}
9797

9898
#[test]
99-
fn choose_one_weighted_indexed() {
99+
fn sample_one_weighted_indexed() {
100100
struct Adapter<F: Fn(i64) -> f64>(Vec<i64>, F);
101101
impl<F: Fn(i64) -> f64> Distribution<i64> for Adapter<F> {
102102
fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> i64 {
103-
*IndexedRandom::choose_multiple_weighted(&self.0[..], rng, 1, |i| (self.1)(*i))
103+
*IndexedRandom::sample_weighted(&self.0[..], rng, 1, |i| (self.1)(*i))
104104
.unwrap()
105105
.next()
106106
.unwrap()
@@ -120,13 +120,12 @@ fn choose_one_weighted_indexed() {
120120
}
121121

122122
#[test]
123-
fn choose_two_weighted_indexed() {
123+
fn sample_two_weighted_indexed() {
124124
struct Adapter<F: Fn(i64) -> f64>(Vec<i64>, F);
125125
impl<F: Fn(i64) -> f64> Distribution<i64> for Adapter<F> {
126126
fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> i64 {
127127
let mut iter =
128-
IndexedRandom::choose_multiple_weighted(&self.0[..], rng, 2, |i| (self.1)(*i))
129-
.unwrap();
128+
IndexedRandom::sample_weighted(&self.0[..], rng, 2, |i| (self.1)(*i)).unwrap();
130129
let mut a = *iter.next().unwrap();
131130
let mut b = *iter.next().unwrap();
132131
assert!(iter.next().is_none());
@@ -204,12 +203,12 @@ fn choose_stable_iterator() {
204203
}
205204

206205
#[test]
207-
fn choose_two_iterator() {
206+
fn sample_two_iterator() {
208207
struct Adapter<I>(I);
209208
impl<I: Clone + Iterator<Item = i64>> Distribution<i64> for Adapter<I> {
210209
fn sample<R: rand::Rng + ?Sized>(&self, rng: &mut R) -> i64 {
211210
let mut buf = [0; 2];
212-
IteratorRandom::choose_multiple_fill(self.0.clone(), rng, &mut buf);
211+
IteratorRandom::sample_fill(self.0.clone(), rng, &mut buf);
213212
buf.sort_unstable();
214213
assert!(buf[0] < 99 && buf[1] >= 1);
215214
let a = buf[0];

0 commit comments

Comments
 (0)