How it works...

Since we have declared the variable type mutable, the Rust compiler allows the developer to change the data value assigned any number of times in the scope of the functions.

In the preceding program, we created a variable named sample_var and explicitly marked it as mutable type during its assignment. Due to this action, the Rust compiler allows the variables to be assigned different values.

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

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