about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorgareins <ozbolt.menegatti@gmail.com>2015-04-26 23:16:49 +0200
committergareins <ozbolt.menegatti@gmail.com>2015-04-26 23:16:49 +0200
commitde35823d49e72b0db8dce1c94edfba77458cda84 (patch)
treeed8fcfc7ec4adf6e4991eb548d13eb100090195a /src
parentbba18fec45b0764c1c65b8f0d3ea1fb50ad8a57b (diff)
downloadrust-de35823d49e72b0db8dce1c94edfba77458cda84.tar.gz
rust-de35823d49e72b0db8dce1c94edfba77458cda84.zip
IMO better borrow_mut() documentation on RefCell
Previous borrow() is enough to make borrow_mut() panic, no need to have borrow_mut() twice. [This](http://is.gd/woKKAW)
Diffstat (limited to 'src')
-rw-r--r--src/libcore/cell.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index df0de234b9a..b4b25258bbf 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -417,7 +417,7 @@ impl<T> RefCell<T> {
     ///
     /// let result = thread::spawn(move || {
     ///    let c = RefCell::new(5);
-    ///    let m = c.borrow_mut();
+    ///    let m = c.borrow();
     ///
     ///    let b = c.borrow_mut(); // this causes a panic
     /// }).join();