BetterRefCell
A drop-in replacement for RefCell with safe unborrow and reborrow capabilities.
Features
- Allows putting back a borrowed value and reborrowing it within a closure.
- Fully compatible with the
RefCellinterface of the stable Rust standard library. - Zero dependencies.
Usage
use BetterRefCell;
use *;
let cell = new;
let mut guard: = cell.borrow_mut;
let mut_reference: &mut i32 = &mut *guard;
let ret = cell.unborrow;
assert_eq!;
assert_eq!;
License
This project is dual-licensed under either the MIT or Apache-2.0 license, at your option.