mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Rollup merge of #72606 - GuillaumeGomez:cell-example-update, r=Dylan-DPC
Small cell example update r? @Dylan-DPC
This commit is contained in:
commit
36d6118666
@ -849,11 +849,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…
Reference in New Issue
Block a user