You've already forked comprehensive-rust
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:
@@ -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>
|
||||
|
Reference in New Issue
Block a user