Mutable References
We want to be able to modify the fruit using the increase_fruit
function. To make this work, we need to introduce a second kind of reference: a mutable reference. While an immutable reference is &
, a mutable reference is &mut
. It looks like this:
Get hands-on with 1400+ tech skills courses.