blob: 523f4d5a82795dc953a1202b987811e7763514d1 (
plain)
1
2
3
4
5
6
|
[[Rust]]
[[Mutable references are safe because they prevent aliasing]]
---
Because references are also immutable by default, if we would declare a variable mutable such as `let mut guess = String::new();` and we were to pass a references to guess to another function, we must place the `mut` keyword there as well as such: `read_line(&mut guess)` rather than just `read_line(&guess)`.
|