@@ -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