cells/
cells.rs

1use std::cell::RefCell;
2
3use stack_box::FitStackBox;
4
5type CellBox<T> = FitStackBox!(RefCell<T>, RefCell<u32>);
6
7fn main() {
8    let cb = CellBox::new(RefCell::new(10u32)); // internal mutability
9    let r1 = cb.borrow();
10    let r2 = cb.borrow();
11    drop((r1, r2));
12    *cb.borrow_mut() = 99;
13}