typo fix: cell-refcell.md

pull/1385/head
想出网名啦 1 year ago committed by GitHub
parent ddc158db47
commit 1df5525832
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -182,7 +182,7 @@ error[E0596]: cannot borrow `self.msg_cache` as mutable, as it is behind a `&` r
| ^^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be borrowed as mutable
```
在报错的同时,编译器大聪明还善意地给出了提示:将 `&self` 修改为 `&mut self`,但是。。。我们实现的特征是定义在外部库中,因此该签名根本不能修改。此危急关头, `RefCell` 闪亮登场:
在报错的同时,编译器大聪明还善意地给出了提示:将 `&self` 修改为 `&mut self`,但是。。。我们实现的特征是定义在外部库中,因此该签名根本不能修改。此危急关头, `RefCell` 闪亮登场:
```rust
use std::cell::RefCell;

Loading…
Cancel
Save