std_macro_extensions/ref_cell/macro.rs
1/// Creates a new `RefCell` instance.
2///
3/// This macro takes a value and wraps it in a `RefCell`, providing interior mutability with dynamic borrow checking.
4/// `RefCell` allows mutable access to its contents even when it is shared among multiple references.
5#[macro_export]
6macro_rules! refcell {
7 ($val:expr) => {
8 std::cell::RefCell::new($val)
9 };
10}