1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-12-22 22:51:12 +02:00
Files
comprehensive-rust/src/references/solution.md

323 B

Solution

{{#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 mutable reference to an array, which causes the for loop to give mutable references to each element.