#array #element #random #pick

pick-one

Picks one random element from an array

2 stable releases

Uses old Rust 2015

1.0.1 Oct 1, 2016

#20 in #pick

Download history 27/week @ 2024-03-11 22/week @ 2024-03-18 29/week @ 2024-03-25 66/week @ 2024-04-01 13/week @ 2024-04-08 21/week @ 2024-04-15 19/week @ 2024-04-22 18/week @ 2024-04-29 18/week @ 2024-05-06 23/week @ 2024-05-13 19/week @ 2024-05-20 19/week @ 2024-05-27 18/week @ 2024-06-03 15/week @ 2024-06-10 13/week @ 2024-06-17 22/week @ 2024-06-24

70 downloads per month
Used in 5 crates

MIT license

2KB

rust-pick-one

Picks one random element from an array

Usage

In Cargo.toml:

[dependencies]
pick-one = "1.0.1"

In your lib.rs or main.rs:

extern crate pick_one;

let random_choice = pick_one::pick_one_str(&["doggo"]);

Dependencies

~315–540KB