Skip to main content

scope_restore

Macro scope_restore 

Source
macro_rules! scope_restore {
    ($val:ident, $ours:expr_2021) => { ... };
}
Expand description

Temporarily replaces a value and restores the previous value at scope exit.

The first argument is a mutable-reference identifier, and the second becomes its temporary value. A deferred drop guard performs restoration on normal return, early return, or unwinding.