Mutable borrows
Description
In the shared borrows tutorial, we learned that how to use shared
references (&T
) to give temporary, read-only access to data. This
tuturial covers mutable references (&mut T
), which allow the data to
be mutated while it is borrowed. This tutorial completes the tour of
Rust’s ownership model.
After completing the tutorial, please let us know what you think!
Exercises
- Mutable borrows
The syntax can be a bit tricky. If you like, click here for a hint.