Small cell example update
This commit is contained in:
parent
97f3eeec82
commit
b9ba4b3810
1 changed files with 3 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue