Skip to content

Commit

Permalink
Merge pull request #49 from jbhannah/dependabot/cargo/rand-0.9.0-alpha.2
Browse files Browse the repository at this point in the history
Bump rand from 0.9.0-alpha.1 to 0.9.0-alpha.2
  • Loading branch information
jbhannah authored Aug 15, 2024
2 parents 4db13d1 + 4a920f2 commit 5ba0844
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ arboard = "3.1.0"
assert_cmd = "2.0.16"
clap = { version = "4.5.15", features = ["derive"] }
lazy_static = "1.4.0"
rand = "0.9.0-alpha.1"
rand = "0.9.0-alpha.2"

[profile.release]
codegen-units = 1
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn join<R: Rng + ?Sized>(picked: Vec<&str>, separators: &[&str], rng: &mut R
.into_iter()
.map(|name| name.to_owned())
.reduce(|password, next| {
let i = rng.gen::<usize>() % separators.len();
let i = rng.random::<u32>() as usize % separators.len();
format!("{}{}{}", password, separators[i], next)
})
.unwrap_or_else(|| "".to_string())
Expand Down Expand Up @@ -109,7 +109,7 @@ mod test {
let mut rng = rng_from_seed(POKEMON_COUNT);

assert_eq!(
"Makuhita6Milotic2Shiftry7Charmander".to_string(),
"Makuhita0Milotic6Shiftry8Charmander".to_string(),
generate(None, 4, "digit", &mut rng)
);
}
Expand All @@ -121,7 +121,7 @@ mod test {
let mut rng = rng_from_seed(POKEMON_COUNT);

assert_eq!(
"Makuhita]Milotic!Shiftry-Charmander".to_string(),
"Makuhita=Milotic;Shiftry]Charmander".to_string(),
generate(None, 4, "special", &mut rng)
);
}
Expand All @@ -134,7 +134,7 @@ mod test {
let picked = vec!["Lilligant", "Tranquill", "Shelmet", "Mesprit"];

assert_eq!(
"Lilligant6Tranquill2Shelmet7Mesprit",
"Lilligant0Tranquill6Shelmet8Mesprit",
join(picked, DIGITS, &mut rng)
);
}
Expand Down

0 comments on commit 5ba0844

Please sign in to comment.