Adjusted intro error to match code
The error in the Brief Introduction shows the problematic line as "x.push(4)", while the example code uses a vector of strings.
This commit is contained in:
parent
f4ab2b3a25
commit
9ddfbb1ae2
1 changed files with 1 additions and 1 deletions
|
|
@ -127,7 +127,7 @@ vector. When we try to compile this program, we get an error:
|
|||
|
||||
```text
|
||||
error: cannot borrow `x` as mutable because it is also borrowed as immutable
|
||||
x.push(4);
|
||||
x.push("foo");
|
||||
^
|
||||
note: previous borrow of `x` occurs here; the immutable borrow prevents
|
||||
subsequent moves or mutable borrows of `x` until the borrow ends
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue