Skip to content

Commit b9ba4b3

Browse files
Small cell example update
1 parent 97f3eee commit b9ba4b3

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
@@ -850,11 +850,11 @@ impl<T: ?Sized> RefCell<T> {
850850
/// ```
851851
/// use std::cell::RefCell;
852852
///
853-
/// let c = RefCell::new(5);
853+
/// let c = RefCell::new("hello".to_owned());
854854
///
855-
/// *c.borrow_mut() = 7;
855+
/// *c.borrow_mut() = "bonjour".to_owned();
856856
///
857-
/// assert_eq!(*c.borrow(), 7);
857+
/// assert_eq!(&*c.borrow(), "bonjour");
858858
/// ```
859859
///
860860
/// An example of panic:

0 commit comments

Comments
 (0)