From de35823d49e72b0db8dce1c94edfba77458cda84 Mon Sep 17 00:00:00 2001 From: gareins Date: Sun, 26 Apr 2015 23:16:49 +0200 Subject: [PATCH] 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) --- src/libcore/cell.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 RefCell { /// /// 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();