1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-10-09 10:55:26 +02:00

Add a speaker note about mut function args (#2910)

This commit is contained in:
Nicole L
2025-09-18 17:25:47 -07:00
committed by GitHub
parent 9e32680064
commit 8b4849854a

View File

@@ -3,3 +3,12 @@
```rust,editable
{{#include exercise.rs:solution}}
```
<details>
- Note that the argument `n` is marked as `mut`, allowing you to change the
value of `n` in the function. Like variables, function arguments are immutable
by default and you must add `mut` if you want to modify their value. This does
not affect how the function is called or how the argument is passed in.
</details>