X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/02337846140cac7ff30e3cc64fd3c9a024bee17c..375923e203d323dadc639434ebc1f29530f4ac2a:/src/part12.rs diff --git a/src/part12.rs b/src/part12.rs index 6803aca..e7ccf99 100644 --- a/src/part12.rs +++ b/src/part12.rs @@ -11,7 +11,6 @@ use std::cell::{Cell, RefCell}; //@ This restriction propagates up to `Callbacks` itself. What could we do about this? //@ ## `Rc` - //@ The solution is to find some way of cloning `Callbacks` without cloning the environments. This //@ can be achieved with `Rc`, a *reference-counted* pointer. This is is another example of a //@ smart pointer. You can `clone` an `Rc` as often as you want, that doesn't affect the data it @@ -143,7 +142,6 @@ impl CallbacksMut { // `borrow_mut`. //@ At run-time, the cell will keep track of the number of outstanding shared and //@ mutable references, and panic if the rules are violated.
- //@ For this check to be performed, `closure` is a *guard*: Rather than a normal //@ reference, `borrow_mut` returns a smart pointer ([`RefMut`](https://doc.rust- //@ lang.org/stable/std/cell/struct.RefMut.html), in this case) that waits until is