Skip to main content

pick

Function pick 

Source
pub fn pick<'a, T, R: RandomSource>(items: &'a [T], rng: &mut R) -> &'a T
Expand description

Pick an element from a slice using the given random source.

Panics if items is empty.