From d05b7c63ff50b3f9126bb5533e0ba5dd424b83d1 Mon Sep 17 00:00:00 2001 From: Yoshito Komatsu Date: Tue, 13 Dec 2016 15:09:00 +0900 Subject: [PATCH] Fix trivial issues --- src/ch03-02-data-types.md | 2 +- src/ch03-05-control-flow.md | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ch03-02-data-types.md b/src/ch03-02-data-types.md index e855834598..dc367f0a0f 100644 --- a/src/ch03-02-data-types.md +++ b/src/ch03-02-data-types.md @@ -78,7 +78,7 @@ the scope of this book). Each signed variant can store numbers from -(2n - 1) to 2n - 1 - 1 inclusive, where `n` is the number of bits that variant uses. So an -`i8` can store numbers from -(27) to 27, which equals +`i8` can store numbers from -(27) to 27 - 1, which equals -128 to 127. Unsigned variants can store numbers from 0 to 2n - 1, so a `u8` can store numbers from 0 to 28 - 1, which equals 0 to 255. diff --git a/src/ch03-05-control-flow.md b/src/ch03-05-control-flow.md index 8aa856afdd..e813bf4d48 100644 --- a/src/ch03-05-control-flow.md +++ b/src/ch03-05-control-flow.md @@ -35,12 +35,12 @@ condition. In this case, the condition checks whether or not the variable condition is true is placed immediately after the condition inside curly braces. Blocks of code associated with the conditions in `if` expressions are sometimes called *arms*, just like the arms in `match` expressions that we -discussed in the “Comparing the Guess to the Secret Number” section of Chapter -2. Optionally, we can also include an `else` expression, which we chose to do -here, to give the program an alternative block of code to execute should the -condition evaluate to false. If you don’t provide an `else` expression and the -condition is false, the program will just skip the `if` block and move on to -the next bit of code. +discussed in the “Comparing the Guess to the Secret Number” section of +Chapter 2. Optionally, we can also include an `else` expression, which we chose +to do here, to give the program an alternative block of code to execute should +the condition evaluate to false. If you don’t provide an `else` expression and +the condition is false, the program will just skip the `if` block and move on +to the next bit of code. Try running this code; you should see the following output: