use read_fonts::collections::IntSet; use rand::Rng; pub fn random_set(size: u32, max_value: u32) -> IntSet { let mut rng = rand::thread_rng(); let mut set = IntSet::::empty(); for _ in 0..size { loop { let candidate: u32 = rng.gen::() % max_value; if set.insert(candidate) { break; } } } set }