mirror of
https://github.com/rust-lang/book.git
synced 2026-11-30 20:34:52 -06:00
@@ -230,7 +230,7 @@ Listing 15-15: Using `Rc<RefCell<i32>>` to create a `List` that we can mutate
|
|||||||
</figcaption>
|
</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
|
||||||
We're creating a value, which is an instance of `Rc<RefCell<i32>>. We're
|
We're creating a value, which is an instance of `Rc<RefCell<i32>>`. We're
|
||||||
storing it in a variable named `value` because we want to be able to access it
|
storing it in a variable named `value` because we want to be able to access it
|
||||||
directly later. Then we create a `List` in `a` that has a `Cons` variant that
|
directly later. Then we create a `List` in `a` that has a `Cons` variant that
|
||||||
holds `value`, and `value` needs to be cloned since we want `value` to also
|
holds `value`, and `value` needs to be cloned since we want `value` to also
|
||||||
|
|||||||
Reference in New Issue
Block a user