about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-27 03:09:19 +0200
committerGitHub <noreply@github.com>2020-05-27 03:09:19 +0200
commit36d611866612c99ce7d2e82f27fdfc70c058658a (patch)
treede5f7cf4efb5e58e45a49a7342577ee32fc91bc9
parent2b3b115a4deac7b8c72d0028576cd4c6dbf036d8 (diff)
parentb9ba4b3810a4f818d2a1e4eb5b17841bd799e519 (diff)
downloadrust-36d611866612c99ce7d2e82f27fdfc70c058658a.tar.gz
rust-36d611866612c99ce7d2e82f27fdfc70c058658a.zip
Rollup merge of #72606 - GuillaumeGomez:cell-example-update, r=Dylan-DPC
Small cell example update

r? @Dylan-DPC
-rw-r--r--src/libcore/cell.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index fad3095f8a3..c4c1d2824b0 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -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: