From 7c492c2b8d33934d5b225a6d84b6ed497db3cb05 Mon Sep 17 00:00:00 2001 From: mag1cianag Date: Mon, 17 Jan 2022 14:32:39 +0800 Subject: [PATCH] update cell-refcell --- book/contents/advance/smart-pointer/cell-refcell.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/contents/advance/smart-pointer/cell-refcell.md b/book/contents/advance/smart-pointer/cell-refcell.md index 9de55da5..c611fbc6 100644 --- a/book/contents/advance/smart-pointer/cell-refcell.md +++ b/book/contents/advance/smart-pointer/cell-refcell.md @@ -345,7 +345,7 @@ fn retain_even(nums: &mut Vec) { ## 总结 -`Cell`和`RefCell`都为我们带来了内部可见性这个重要特性,同时还将借用规则的检查从编译期推迟到运行期,但是这个检查并不能被绕过,该来早晚还是会来,`RefCell在运行期的报错会造成`panic` +`Cell`和`RefCell`都为我们带来了内部可变性这个重要特性,同时还将借用规则的检查从编译期推迟到运行期,但是这个检查并不能被绕过,该来早晚还是会来,`RefCell`在运行期的报错会造成`panic` `RefCell`适用于编译器误报或者一个引用被在多个代码中使用、修改以至于难于管理借用关系时,还有就是需要内部可变性时。