book icon indicating copy to clipboard operation
book copied to clipboard

Mutable reference/mutable variable clarification in Chapter 4.2

Open Aric5301 opened this issue 2 years ago • 1 comments
trafficstars

Hello. I have started learning Rust and have a small suggestion for chapter 4.2. I think that it's worth it to directly state that you can create a mutable reference only to a mutable variable, meaning that you can't create a mutable reference to an unmutable variable. After reading the chapter I was left with that question in mind ("What if I create a mutable reference to an unmutable variable? Is it even possible?"). Of course that I quickly opened the compiler and checked for my self, but still I think that it's worth adding. Thanks!

Aric5301 avatar Oct 24 '23 19:10 Aric5301