Skip to content

Commit 36d6118

Browse files
authored
Rollup merge of #72606 - GuillaumeGomez:cell-example-update, r=Dylan-DPC
Small cell example update r? @Dylan-DPC
2 parents 2b3b115 + b9ba4b3 commit 36d6118

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libcore/cell.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -849,11 +849,11 @@ impl<T: ?Sized> RefCell<T> {
849849
/// ```
850850
/// use std::cell::RefCell;
851851
///
852-
/// let c = RefCell::new(5);
852+
/// let c = RefCell::new("hello".to_owned());
853853
///
854-
/// *c.borrow_mut() = 7;
854+
/// *c.borrow_mut() = "bonjour".to_owned();
855855
///
856-
/// assert_eq!(*c.borrow(), 7);
856+
/// assert_eq!(&*c.borrow(), "bonjour");
857857
/// ```
858858
///
859859
/// An example of panic:

0 commit comments

Comments
 (0)