Skip to content

Commit

Permalink
Add speaker note about for and array refs (#2665)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison authored Feb 28, 2025
1 parent a4469e7 commit 526dddc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/references/solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
```rust,editable
{{#include exercise.rs:solution}}
```

<details>

- Note that in `normalize` we were able to do `*item /= mag` to modify each
element. This is because we're iterating using a mutable reference to an
array, which causes the `for` loop to give mutable references to each element.

</details>

0 comments on commit 526dddc

Please sign in to comment.