Exercises
Explore practical exercises focused on Rust references, borrowing rules, lifetimes, and mutability to deepen your understanding. Learn to identify and fix common bugs, manage mutable and immutable references, effectively use dereferencing, and handle borrow errors. These tasks will help solidify your skills in Rust's core ownership principles and safe memory management.
We'll cover the following...
We'll cover the following...
Exercise 1
The is_five function below has a bug. You can fix it by either adding in a borrow (&) or deref (*). Try fixing it both ways.
Exercise 2
Fix the call to the add function inside ...