My own answer which produces the same effect is:
use rand::seq::IteratorRandom;
fn main() {
let mut rng = rand::rng();
let values = vec![1, 2, 3, 4, 5] as Vec<i32>;
let samples: Vec<_> = (1..10).map(|_| *values.iter().choose(&mut rng).unwrap()).collect();
println!("{:?}", samples);
}
Remark: I am not however sure how to fix the seed to have exactly reproducible results.