|
|
|
|
|
by coderjames
4421 days ago
|
|
[disclaimer: still learning Rust] I believe it actually means that y can be made to reference something other than x. let x = 5
let mut y = &x
let i = 13
y = &i
This is similar to C++'s const-pointers and pointers-to-consts, where either a pointer cannot be made to point at something different or the pointer cannot be used to change what it points at. |
|