std_macro_extensions/cell/
macro.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Creates a new `Cell` instance.
///
/// This macro takes an expression and wraps it in a `Cell`, providing interior mutability for the given value.
/// The `Cell` type allows for mutation of its contents even when shared among multiple references.
///
/// # Examples
/// ```
/// use std_macro_extensions::*;
/// let cell_value = cell!(5);
/// cell_value.set(10);
/// ```
#[macro_export]
macro_rules! cell {
    ($val:expr) => {
        std::cell::Cell::new($val)
    };
}