use std::rc::Rc;
use qcell::{QCell, QCellOwner};

// https://docs.rs/qcell/latest/qcell/
fn main() {
    let mut owner = QCellOwner::new();

    let item = Rc::new(QCell::new(&owner, Vec::<u8>::new()));
    let iref = owner.rw(&item);
    // test(&mut owner, &item);    // Compile error
    iref.push(1);

    fn test(owner: &mut QCellOwner, item: &Rc<QCell<Vec<u8>>>) {
        owner.rw(&item).push(2);
    }
}
