extend_mut

Function extend_mut

Source
pub fn extend_mut<'a, 'b, T: 'b, R>(
    mut_ref: &'a mut T,
    f: impl FnOnce(&'b mut T) -> (&'b mut T, R),
) -> R
Expand description

Extends the lifetime of a mutable reference. Note that f must return the same reference that was passed to it, otherwise it will abort the process.