From 3cd531b472ec7a7af752fa5a179686b844c82c0b Mon Sep 17 00:00:00 2001 From: Nicole LeGare Date: Wed, 26 Feb 2025 17:37:01 -0800 Subject: [PATCH] Add speaker note about `for` and array refs --- src/references/solution.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/references/solution.md b/src/references/solution.md index b4a4c92cd998..d0ea0db9fc42 100644 --- a/src/references/solution.md +++ b/src/references/solution.md @@ -3,3 +3,11 @@ ```rust,editable {{#include exercise.rs:solution}} ``` + +
+ +- Note that in `normalize` we were able to do `*item /= mag` to modify each + element. This is because we're iterating using a reference to an array, which + causes the `for` loop to give references to each element. + +