From: Ralf Jung Date: Tue, 7 Jun 2016 13:39:00 +0000 (+0200) Subject: Merge pull request #11 from deepaksirone/fix_typo X-Git-Url: https://git.ralfj.de/rust-101.git/commitdiff_plain/d5cee5ca7d257faea7f68b8812bf4d1a88ab5229?hp=ba0f3868b5b76e5effcb5fb22d6bc26d790dbcc4 Merge pull request #11 from deepaksirone/fix_typo Fix typos --- diff --git a/src/part12.rs b/src/part12.rs index 34e994e..7d03ca6 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 @@ -92,7 +92,7 @@ fn demo_cell(c: &mut Callbacks) { //@ Putting it all together, the story around mutation and ownership through references looks as follows: There are *unique* references, //@ which - because of their exclusivity - are always safe to mutate through. And there are *shared* references, where the compiler cannot //@ generally promise that mutation is safe. However, if extra circumstances guarantee that mutation *is* safe, then it can happen even -//@ through a sahred reference - as we saw with `Cell`. +//@ through a shared reference - as we saw with `Cell`. // ## `RefCell` //@ As the next step in the evolution of `Callbacks`, we could try to solve this problem of mutability once and for all, by adding `Cell`