From 06d8b21372742234c95e1ea842e4d66aa9ee9dd5 Mon Sep 17 00:00:00 2001 From: Tang Chenglong <ideami@outlook.com> Date: Sun, 20 Mar 2016 21:24:46 +0800 Subject: [PATCH] docs: Correct an improper description In the example, we made a immutable borrow to `println!`, not a mutable one. --- src/doc/book/references-and-borrowing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/book/references-and-borrowing.md b/src/doc/book/references-and-borrowing.md index 74983c1255333..a08d53f958ba3 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: