fn add_channel(channel: Channel) -> u32 {
    let id = RNG.with(|rng| rng.borrow_mut().gen());
    match CHANNELS.entry(id) {
        Entry::Vacant(ve) => ve.insert(channel),
        Entry::Occupied(_) => return add_channel(channel), // try another id
    };
    id
}
// Assigns a random id to the `channel` and adds it to the global CHANNELS map.
Assigns a random id to the `channel` and adds it to the global CHANNELS map.
Assigns a random id to the ` channel ` and adds it to the global CHANNELS map .
fn add_channel(channel: Channel) -> u32 {
    let id = RNG.with(|rng| rng.borrow_mut().gen());
    match CHANNELS.entry(id) {
        Entry::Vacant(ve) => ve.insert(channel),
        Entry::Occupied(_) => return add_channel(channel), // try another id
    };
    id
}
fn add_channel ( channel : Channel ) -> u32 { let id = RNG . with ( | rng | rng . borrow_mut ( ) . gen ( ) ) ; match CHANNELS . entry ( id ) { Entry :: Vacant ( ve ) => ve . insert ( channel ) , Entry :: Occupied ( _ ) => return add_channel ( channel ) , // try another id } ; id }
Assigns a random id to the `channel` and adds it to the global CHANNELS map.
Assigns a random id to the ` channel ` and adds it to the global CHANNELS map .
channel
Channel
channel
Channel