Increasing Fruit
Explore how to manipulate Rust structs by implementing the increase_fruit function using struct expressions and field access. Understand how mutability and ownership rules work together to safely update data within functions. Gain practical experience fixing compiler errors and applying mutation to enhance your Rust programming skills.
We'll cover the following...
We'll cover the following...
Our count_fruit function received a Fruit parameter and returned a Fruit result. And it gave back exactly the same amount. Now we’ll want to make a new, modified value. First, let’s see what we want our main function to look like:
We’re not going to ...