From da0f1d0d8c4327e3140aa8df293d62e6946269c5 Mon Sep 17 00:00:00 2001 From: David Deprost Date: Wed, 8 Mar 2017 15:09:29 +0100 Subject: [PATCH 1/2] Update ch15-01-box.md Forgot the article 'a' --- second-edition/src/ch15-01-box.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/second-edition/src/ch15-01-box.md b/second-edition/src/ch15-01-box.md index e3cad50e0..3834a0f81 100644 --- a/second-edition/src/ch15-01-box.md +++ b/second-edition/src/ch15-01-box.md @@ -116,7 +116,7 @@ would take to store the largest of its variants. Contrast this to what happens when the Rust compiler looks at a recursive type like `List` in Listing 15-2. The compiler tries to figure out how much memory -is needed to store value of `List`, and starts by looking at the `Cons` +is needed to store a value of `List`, and starts by looking at the `Cons` variant. The `Cons` variant holds a value of type `i32` and a value of type `List`, so `Cons` needs an amount of space equal to the size of an `i32` plus the size of a `List`. To figure out how much memory a `List` needs, it looks at From c2312ca4625b2922f496498eab547b85328f335e Mon Sep 17 00:00:00 2001 From: David Deprost Date: Wed, 8 Mar 2017 15:16:39 +0100 Subject: [PATCH 2/2] Update ch15-01-box.md Added article and made sentence more clear. --- second-edition/src/ch15-01-box.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/second-edition/src/ch15-01-box.md b/second-edition/src/ch15-01-box.md index 3834a0f81..47c5e5433 100644 --- a/second-edition/src/ch15-01-box.md +++ b/second-edition/src/ch15-01-box.md @@ -116,7 +116,7 @@ would take to store the largest of its variants. Contrast this to what happens when the Rust compiler looks at a recursive type like `List` in Listing 15-2. The compiler tries to figure out how much memory -is needed to store a value of `List`, and starts by looking at the `Cons` +is needed to store a value of the `List` enum, and starts by looking at the `Cons` variant. The `Cons` variant holds a value of type `i32` and a value of type `List`, so `Cons` needs an amount of space equal to the size of an `i32` plus the size of a `List`. To figure out how much memory a `List` needs, it looks at