提交 a1935364 编写于 作者: C Corey Farwell

RefCell::borrow_mut example should demonstrate mut

上级 62a3a6ec
......@@ -414,7 +414,9 @@ pub fn borrow(&self) -> Ref<T> {
///
/// let c = RefCell::new(5);
///
/// let borrowed_five = c.borrow_mut();
/// *c.borrow_mut() = 7;
///
/// assert_eq!(*c.borrow(), 7);
/// ```
///
/// An example of panic:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册