Skip to content

Commit

Permalink
chore: upgrade rand from 0.8 to 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
fengys1996 committed Feb 10, 2025
1 parent 1a0cec5 commit d725b3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ tracing = { version = "0.1" }

[dev-dependencies]
criterion = { version = "0.5" }
rand = { version = "0.8" }
rand = { version = "0.9" }
tempfile = { version = "3.14" }
tracing-subscriber = { version = "0.3" }

Expand Down
4 changes: 2 additions & 2 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ pub async fn wait_consumer_online(
pub fn gen_str(min_len: usize, max_len: usize) -> String {
const CHARSET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789)(*&^%$#@!~";

let len = rand::random::<usize>() % (max_len - min_len) + min_len;
let len = rand::random::<u32>() as usize % (max_len - min_len) + min_len;

let mut s = String::new();

for _ in 0..len {
s.push(CHARSET[rand::random::<usize>() % CHARSET.len()] as char);
s.push(CHARSET[rand::random::<u32>() as usize % CHARSET.len()] as char);
}

s
Expand Down

0 comments on commit d725b3c

Please sign in to comment.