mirror of
https://github.com/rust-lang/book.git
synced 2026-12-03 14:25:11 -06:00
Add a forward reference about mutability
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user