1
Fork 0

Small cell example update

This commit is contained in:
Guillaume Gomez 2020-05-26 10:47:54 +02:00 committed by GitHub
parent 97f3eeec82
commit b9ba4b3810
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: