diff options
| author | Tang Chenglong <ideami@outlook.com> | 2016-03-20 21:24:46 +0800 |
|---|---|---|
| committer | Tang Chenglong <ideami@outlook.com> | 2016-03-20 21:24:46 +0800 |
| commit | 06d8b21372742234c95e1ea842e4d66aa9ee9dd5 (patch) | |
| tree | 2618b35cff8dceca029279089a245a39bd4759fb /src | |
| parent | 015d3b70929a31af48d056a8e05d113e362339e9 (diff) | |
| download | rust-06d8b21372742234c95e1ea842e4d66aa9ee9dd5.tar.gz rust-06d8b21372742234c95e1ea842e4d66aa9ee9dd5.zip | |
docs: Correct an improper description
In the example, we made a immutable borrow to `println!`, not a mutable one.
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/book/references-and-borrowing.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/doc/book/references-and-borrowing.md b/src/doc/book/references-and-borrowing.md index 74983c12553..a08d53f958b 100644 --- a/src/doc/book/references-and-borrowing.md +++ b/src/doc/book/references-and-borrowing.md @@ -212,7 +212,7 @@ fn main() { In other words, the mutable borrow is held through the rest of our example. What we want is for the mutable borrow by `y` to end so that the resource can be -returned to the owner, `x`. `x` can then provide a mutable borrow to `println!`. +returned to the owner, `x`. `x` can then provide a immutable borrow to `println!`. In Rust, borrowing is tied to the scope that the borrow is valid for. And our scopes look like this: |
