From a19353643bf9ad38dfa05fbea94c01b795989569 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Mon, 25 Jan 2016 17:07:55 -0500 Subject: [PATCH] RefCell::borrow_mut example should demonstrate mut --- src/libcore/cell.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 789b75836d0..6041355e9db 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -414,7 +414,9 @@ pub fn borrow(&self) -> Ref { /// /// let c = RefCell::new(5); /// - /// let borrowed_five = c.borrow_mut(); + /// *c.borrow_mut() = 7; + /// + /// assert_eq!(*c.borrow(), 7); /// ``` /// /// An example of panic: -- GitLab