Make variable mutable to allow mutable reference
This commit is contained in:
parent
3f5d0b5b6c
commit
0493fb2cfc
1 changed files with 1 additions and 1 deletions
|
|
@ -332,7 +332,7 @@ let z = &x;
|
|||
Mutable ones, however, are not:
|
||||
|
||||
```{rust,ignore}
|
||||
let x = 5i;
|
||||
let mut x = 5i;
|
||||
let y = &mut x;
|
||||
let z = &mut x; // error: cannot borrow `x` as mutable more than once at a time
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue