choose-rand 0.2.0

A small crate for choosing random items from a set of weighted items.
Documentation
1
2
3
4
5
use std::cell::RefCell;

pub fn refcellify<T, C: IntoIterator<Item = T>>(c: C) -> impl Iterator<Item = RefCell<T>> {
    c.into_iter().map(|i| RefCell::new(i))
}