Skip to content

Commit de35823

Browse files
committed
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)
1 parent bba18fe commit de35823

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<T> RefCell<T> {
417417
///
418418
/// let result = thread::spawn(move || {
419419
/// let c = RefCell::new(5);
420-
/// let m = c.borrow_mut();
420+
/// let m = c.borrow();
421421
///
422422
/// let b = c.borrow_mut(); // this causes a panic
423423
/// }).join();

0 commit comments

Comments
 (0)