macro_rules! rebinding {
(ref $x:ident) => { ... };
(clone $x:ident) => { ... };
(move $x:ident) => { ... };
(mut $x:ident) => { ... };
}
Expand description
Provides utility for rebinding a variable with different semantics. This macro accepts a pattern specifying the rebinding mode—ref, clone, move, or mut—followed by an identifier, and expands it into a let binding that creates a new binding corresponding to that mode (borrowing immutably, cloning, moving, or borrowing mutably).