From 334c10e3f75281bf5240ea3882bbb80beee0843d Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Sun, 26 Feb 2017 21:24:32 -0500 Subject: [PATCH] Wrap --- src/ch15-06-reference-cycles.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ch15-06-reference-cycles.md b/src/ch15-06-reference-cycles.md index 92352f11c..0467d45e8 100644 --- a/src/ch15-06-reference-cycles.md +++ b/src/ch15-06-reference-cycles.md @@ -156,7 +156,9 @@ inner value will get dropped if the `strong_count` is 0, even if the an `Option` that will be `Some` if the `Rc` value has not been dropped yet, and `None` if the `Rc` value has been dropped. -So in order to make it possible to create lists that point to each other but not create reference cycles, in Listing 15-15, we're going to change our definition of `List` again to hold a `Weak` instead of an `Rc`. +So in order to make it possible to create lists that point to each other but +not create reference cycles, in Listing 15-15, we're going to change our +definition of `List` again to hold a `Weak` instead of an `Rc`.
Filename: src/main.rs @@ -197,7 +199,10 @@ TODO: is this bad software design, collapsing two cases that return `None` like To create `Weak` values, we call the `Rc::downgrade` associated function, which takes an `&Rc` as an argument, and gives a `Weak` back. -Listing 15-16 shows a `main` method where we're trying to create `a` and `b` lists that point to each other, similarly to what we did in Listing 15-14, but this time we won't have a reference cycle and the values will be dropped when they go out of scope at the end of `main`: +Listing 15-16 shows a `main` method where we're trying to create `a` and `b` +lists that point to each other, similarly to what we did in Listing 15-14, but +this time we won't have a reference cycle and the values will be dropped when +they go out of scope at the end of `main`: