about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-05-26 10:47:54 +0200
committerGitHub <noreply@github.com>2020-05-26 10:47:54 +0200
commitb9ba4b3810a4f818d2a1e4eb5b17841bd799e519 (patch)
tree955791d0d5fe1806e56914a39727231828cc90f3 /src
parent97f3eeec8216d7155c24674b9be55e7c672bcae3 (diff)
downloadrust-b9ba4b3810a4f818d2a1e4eb5b17841bd799e519.tar.gz
rust-b9ba4b3810a4f818d2a1e4eb5b17841bd799e519.zip
Small cell example update
Diffstat (limited to 'src')
-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 0f2665eba6f..40a4fb50c99 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -850,11 +850,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: