@@ -662,8 +662,8 @@ where
662662
663663#[ cfg( test) ]
664664mod tests {
665- use rand:: rng;
666665 use rand:: seq:: SliceRandom ;
666+ use rand:: thread_rng;
667667 use rand:: Rng ;
668668
669669 use super :: * ;
@@ -691,7 +691,7 @@ mod tests {
691691 ] ;
692692 let mut result: Vec < Option < i32 > > = Vec :: with_capacity ( size) ;
693693 let mut ix = 0 ;
694- let mut rng = rng ( ) ;
694+ let mut rng = thread_rng ( ) ;
695695 // run length can go up to 8. Cap the max run length for smaller arrays to size / 2.
696696 let max_run_length = 8_usize . min ( 1_usize . max ( size / 2 ) ) ;
697697 while result. len ( ) < size {
@@ -700,7 +700,7 @@ mod tests {
700700 seed. shuffle ( & mut rng) ;
701701 }
702702 // repeat the items between 1 and 8 times. Cap the length for smaller sized arrays
703- let num = max_run_length. min ( rand:: rng ( ) . random_range ( 1 ..=max_run_length) ) ;
703+ let num = max_run_length. min ( rand:: thread_rng ( ) . gen_range ( 1 ..=max_run_length) ) ;
704704 for _ in 0 ..num {
705705 result. push ( seed[ ix] ) ;
706706 }
@@ -1000,7 +1000,7 @@ mod tests {
10001000 let mut logical_indices: Vec < u32 > = ( 0_u32 ..( logical_len as u32 ) ) . collect ( ) ;
10011001 // add same indices once more
10021002 logical_indices. append ( & mut logical_indices. clone ( ) ) ;
1003- let mut rng = rng ( ) ;
1003+ let mut rng = thread_rng ( ) ;
10041004 logical_indices. shuffle ( & mut rng) ;
10051005
10061006 let physical_indices = run_array. get_physical_indices ( & logical_indices) . unwrap ( ) ;
@@ -1036,7 +1036,7 @@ mod tests {
10361036 let mut logical_indices: Vec < u32 > = ( 0_u32 ..( slice_len as u32 ) ) . collect ( ) ;
10371037 // add same indices once more
10381038 logical_indices. append ( & mut logical_indices. clone ( ) ) ;
1039- let mut rng = rng ( ) ;
1039+ let mut rng = thread_rng ( ) ;
10401040 logical_indices. shuffle ( & mut rng) ;
10411041
10421042 // test for offset = 0 and slice length = slice_len
0 commit comments