From bef6c14c9445c161c9ff1aed2cf121a72f4119e9 Mon Sep 17 00:00:00 2001 From: zealchen Date: Sat, 24 Feb 2024 13:10:07 +0800 Subject: [PATCH] fix CI problems. --- src/components/skiplist/benches/bench.rs | 8 ++++---- src/meta_client/src/load_balance.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/skiplist/benches/bench.rs b/src/components/skiplist/benches/bench.rs index 66c51156ee..b048f73727 100644 --- a/src/components/skiplist/benches/bench.rs +++ b/src/components/skiplist/benches/bench.rs @@ -76,13 +76,13 @@ fn bench_read_write_skiplist_frac(b: &mut Bencher<'_>, frac: &usize) { let mut rng = rand::thread_rng(); while !s.load(Ordering::SeqCst) { let key = random_key(&mut rng); - let case = (key, frac > rng.gen_range(0, 11)); + let case = (key, frac > rng.gen_range(0..11)); skiplist_round(&l, &case, &v); } }); let mut rng = rand::thread_rng(); b.iter_batched_ref( - || (random_key(&mut rng), frac > rng.gen_range(0, 11)), + || (random_key(&mut rng), frac > rng.gen_range(0..11)), |case| skiplist_round(&list, case, &value), BatchSize::SmallInput, ); @@ -127,7 +127,7 @@ fn bench_read_write_map_frac(b: &mut Bencher<'_>, frac: &usize) { let handle = thread::spawn(move || { let mut rng = rand::thread_rng(); while !thread_stop.load(Ordering::SeqCst) { - let f = rng.gen_range(0, 11); + let f = rng.gen_range(0..11); let case = (random_key(&mut rng), f < frac); map_round(&map_in_thread, &case, &v); } @@ -135,7 +135,7 @@ fn bench_read_write_map_frac(b: &mut Bencher<'_>, frac: &usize) { let mut rng = rand::thread_rng(); b.iter_batched_ref( || { - let f = rng.gen_range(0, 11); + let f = rng.gen_range(0..11); (random_key(&mut rng), f < frac) }, |case| map_round(&map, case, &value), diff --git a/src/meta_client/src/load_balance.rs b/src/meta_client/src/load_balance.rs index 5c2a92ac29..79ca96b2b9 100644 --- a/src/meta_client/src/load_balance.rs +++ b/src/meta_client/src/load_balance.rs @@ -46,7 +46,7 @@ impl LoadBalancer for RandomLoadBalancer { return Ok(&addresses[0]); } let mut rng = rand::thread_rng(); - let idx = rng.gen_range(0, len); + let idx = rng.gen_range(0..len); Ok(&addresses[idx]) }