0

Rust – error[E0384]: cannot assign twice to immutable variable

By default, variables are immutable in Rust. This design helps up write concurrent codes and avoid common problems that come along with concurrency.

Sample Erring Codes

Output

How to Fix

To make a variable mutable, use the mut keyword between the let keyword and variable name. For example:

Modified Codes

Output

Karl San Gabriel

Karl San Gabriel

Professional Software Developer