Rollup merge of #72606 - GuillaumeGomez:cell-example-update, r=Dylan-DPC

Small cell example update

r? @Dylan-DPC
This commit is contained in:
Dylan DPC 2020-05-27 03:09:19 +02:00 committed by GitHub
commit 36d6118666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -849,11 +849,11 @@ impl<T: ?Sized> RefCell<T> {
/// ```
/// use std::cell::RefCell;
///
/// let c = RefCell::new(5);
/// let c = RefCell::new("hello".to_owned());
///
/// *c.borrow_mut() = 7;
/// *c.borrow_mut() = "bonjour".to_owned();
///
/// assert_eq!(*c.borrow(), 7);
/// assert_eq!(&*c.borrow(), "bonjour");
/// ```
///
/// An example of panic: