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)
This commit is contained in:
parent
bba18fec45
commit
de35823d49
@ -417,7 +417,7 @@ pub fn borrow<'a>(&'a self) -> Ref<'a, 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();
|
||||
|
Loading…
Reference in New Issue
Block a user