When is an immutable variable not an immutable variable?

Up to this point, we have considered variables to be either mutable or immutable, and that's it. However, this is not the case.

Consider the following:

let mut a = 10; 
let b = &mut a; 

What does this actually mean? First, we create a mutable binding to a that initially contains the value 10.

Next, we create an immutable binding to b that contains a reference to the mutable value of a.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset