Loading lesson…
Level 1 · Apprentice0 XP
Use a value without taking it: shared &T or exclusive &mut T, never both at once.
Step 1 / 6
ProblemIf every function took ownership, you would have to pass values back from every call to keep using them. Most functions only need to look at data, or change it briefly.
← → step
Before this: Ownership and moves
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Implement fn dedupe(tags: &mut Vec<String>) and fn longest(words: &[String]) -> Option<&str>. Then write code that holds a reference into a Vec while pushing to it, read the error, and restructure it.