X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/53b9ab56f7b712e6710fd873d456a0fe1f13b785..ab7f9b241429bd675b437d2437799de75d2f409b:/src/part12.rs diff --git a/src/part12.rs b/src/part12.rs index 62f0868..c2331ea 100644 --- a/src/part12.rs +++ b/src/part12.rs @@ -71,7 +71,7 @@ pub fn main() { fn demo_cell(c: &mut Callbacks) { { let count = Cell::new(0); - // Again, we have to move ownership if the `count` into the environment closure. + // Again, we have to move ownership of the `count` into the environment closure. c.register(move |val| { // In here, all we have is a shared reference of our environment. But that's good enough for the `get` and `set` of the cell! //@ At run-time, the `Cell` will be almost entirely compiled away, so this becomes pretty much equivalent to the version @@ -166,4 +166,4 @@ fn demo_mut(c: &mut CallbacksMut) { // **Exercise 12.1**: Write some piece of code using only the available, public interface of `CallbacksMut` such that a reentrant call to a closure // is happening, and the program panics because the `RefCell` refuses to hand out a second mutable borrow of the closure's environment. -//@ [index](main.html) | [previous](part11.html) | [raw source](https://www.ralfj.de/git/rust-101.git/blob_plain/HEAD:/workspace/src/part12.rs) | [next](part13.html) +//@ [index](main.html) | [previous](part11.html) | [raw source](workspace/src/part12.rs) | [next](part13.html)