File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
frameworks/Rust/hyperlane/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,17 +19,17 @@ pub fn escape_html(input: &str) -> String {
1919#[ inline]
2020pub fn get_random_id ( ) -> Queries {
2121 let mut rand: WyRand = WyRand :: new ( ) ;
22- let random_id: Queries = rand. generate :: < Queries > ( ) % ( RANDOM_MAX as Queries + 1 ) ;
23- random_id
22+ let random_id: u32 = rand. generate :: < u32 > ( ) % RANDOM_MAX as u32 + 1 ;
23+ random_id as Queries
2424}
2525
2626#[ inline]
2727pub fn get_random_id_list ( limit : Queries ) -> Vec < i32 > {
2828 let mut id_list: Vec < i32 > = ( 1 ..=limit) . collect ( ) ;
29- let mut rng : WyRand = WyRand :: new ( ) ;
29+ let mut rand : WyRand = WyRand :: new ( ) ;
3030 let len: usize = id_list. len ( ) ;
3131 for i in ( 1 ..len) . rev ( ) {
32- let j = rng . generate_range ( 0 ..=i as u32 ) as usize ;
32+ let j: usize = ( rand . generate :: < u32 > ( ) % RANDOM_MAX as u32 + 1 ) as usize ;
3333 id_list. swap ( i, j) ;
3434 }
3535 id_list. truncate ( limit as usize ) ;
You can’t perform that action at this time.
0 commit comments