Rustlings move_semantics3: Specifying that a function argument is mutable

Chris Biscardi
InstructorChris Biscardi

Social Share Links

Tweet

README for this exercise.

Chris Biscardi: [0:00] In move_semantics3, we're supposed to make a compile without adding any new lines and just changing existing ones. In this case, we can't borrow a vec as mutable inside of fill_vec on line 20. In contrast, for the last two move_semantics, we aren't creating a new vec inside of the fill_vec function this time.

[0:16] If we specify that we want to mutate vec in our type signature, we can then mutate vec and our tests pass.