From 6a13d8079f1f33ece1ba54df8be648b1cba9d450 Mon Sep 17 00:00:00 2001 From: chenxuuu Date: Wed, 12 Jan 2022 10:56:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=91=E5=AD=97=E6=AF=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 b83158e3..9de55da5 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`都为我们带来了内部可见性这个重要特性,同时还将借用规则的检查从编译期推迟到运行期,但是这个检查并不能被绕过,该来早晚还是会来,`R在运行期的报错会造成`panic` +`Cell`和`RefCell`都为我们带来了内部可见性这个重要特性,同时还将借用规则的检查从编译期推迟到运行期,但是这个检查并不能被绕过,该来早晚还是会来,`RefCell在运行期的报错会造成`panic` `RefCell`适用于编译器误报或者一个引用被在多个代码中使用、修改以至于难于管理借用关系时,还有就是需要内部可变性时。