...

/

Mutable References

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:

Access this course and 1400+ top-rated courses and projects.