Skip to content

Commit

Permalink
Use &[…] instead of &Vec<…>
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed Jul 31, 2024
1 parent dca81c2 commit ed82f49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn main() -> Result<()> {
Ok(())
}

fn choose_random_element(elements: &Vec<String>, rng: &mut WyRand) -> String {
fn choose_random_element(elements: &[String], rng: &mut WyRand) -> String {
let random_index = rng.generate_range(0..elements.len());
let element = &elements[random_index];
element.to_owned()
Expand Down

0 comments on commit ed82f49

Please sign in to comment.