Add a forward reference about mutability

This commit is contained in:
Carol (Nichols || Goulding)
2018-03-09 15:34:12 -05:00
parent 75bb1156b4
commit 1ffd35c6db
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -156,8 +156,10 @@ let foo = bar;
```
This line creates a new variable named `foo` and bind it to the value `bar`. In
Rust, variables are immutable by default. The following example shows how to
use `mut` before the variable name to make a variable mutable:
Rust, variables are immutable by default. We’ll be discussing this concept in
detail in the “Variables and Mutability” section in Chapter 3. The following
example shows how to use `mut` before the variable name to make a variable
mutable:
```
let foo = 5; // immutable
@@ -156,8 +156,10 @@ let foo = bar;
```
This line creates a new variable named `foo` and bind it to the value `bar`. In
Rust, variables are immutable by default. The following example shows how to
use `mut` before the variable name to make a variable mutable:
Rust, variables are immutable by default. We’ll be discussing this concept in
detail in the “Variables and Mutability” section in Chapter 3. The following
example shows how to use `mut` before the variable name to make a variable
mutable:
```rust,ignore
let foo = 5; // immutable