You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-12-23 06:56:25 +02:00
14 lines
323 B
Markdown
14 lines
323 B
Markdown
# Solution
|
|
|
|
```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>
|