File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -211,9 +211,10 @@ fn main() {
211
211
```
212
212
213
213
In other words, the mutable borrow is held through the rest of our example. What
214
- we want is for the mutable borrow to end _ before_ we try to call ` println! ` and
215
- make an immutable borrow. In Rust, borrowing is tied to the scope that the
216
- borrow is valid for. And our scopes look like this:
214
+ we want is for the mutable borrow by ` y ` to end so that the resource can be
215
+ returned to the owner, ` x ` . ` x ` can then provide a mutable borrow to ` println! ` .
216
+ In Rust, borrowing is tied to the scope that the borrow is valid for. And our
217
+ scopes look like this:
217
218
218
219
``` rust,ignore
219
220
let mut x = 5;
@@ -378,4 +379,3 @@ statement 1 at 3:14
378
379
379
380
In the above example, ` y ` is declared before ` x ` , meaning that ` y ` lives longer
380
381
than ` x ` , which is not allowed.
381
-
You can’t perform that action at this time.
0 commit comments