Variable mutability

Unlike many other languages, Rust defaults to non-mutability of variables. That means that variable bindings are actually constants if not explicitly defined as mutable. The compiler checks against all variable mutations and refuses to accept mutating non-mutable variable bindings.

If you come from one of the C family of languages, a non-mutable can be considered to be roughly the same as a const type.
..................Content has been hidden....................

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