4 ms·
> That is, suppose I have something that, semantically, I want to move into a function, and which the function later returns. I think I could also pass a `& mut
by rntz 11y ago
> That is, suppose I have something that, semantically, I want to move into a function, and which the function later returns. I think I could also pass a `& mut` instead.
That is exactly what `&mut` is for. An &mut gives you an "ownership lease" on an object; you own it as long as you have the &mut.