Merge pull request #561 from outkaj/master

Fixes #499, #505, and #490
This commit is contained in:
Carol (Nichols || Goulding)
2017-03-24 20:09:43 -04:00
committed by GitHub
3 changed files with 3 additions and 3 deletions

View File

@@ -101,7 +101,7 @@ style is to indent with four spaces, not a tab.
The second important part is `println!`. This is calling a Rust *macro*,
which is how metaprogramming is done in Rust. If it were calling a function
instead, it would look like this: `println` (without the `!`). We'll discuss
Rust macros in more detail in Chapter 24, but for now you just need to know
Rust macros in more detail in Appendix E, but for now you just need to know
that when you see a `!` that means that youre calling a macro instead of a
normal function.

View File

@@ -662,7 +662,7 @@ number this time is 38. When the code compares 50 to 38, the `cmp` method will
return `Ordering::Greater`, because 50 is greater than 38. `Ordering::Greater`
is the value that the `match` expression gets. It looks at the first arms
pattern, `Ordering::Less`, but the value `Ordering::Greater` does not match
`Ordering::Less`. So it ignores the code in that arm and moves to the next arm.
`Ordering::Less`, so it ignores the code in that arm and moves to the next arm.
The next arms pattern, `Ordering::Greater`, *does* match
`Ordering::Greater`! The associated code in that arm will execute and print
`Too big!` to the screen. The `match` expression ends because it has no need to

View File

@@ -3,7 +3,7 @@
Rust has an extremely powerful control-flow operator called `match` that allows
us to compare a value against a series of patterns and then execute code based
on which pattern matches. Patterns can be made up of literal values, variable
names, wildcards, and many other things; Chapter 18 will be about all the
names, wildcards, and many other things; Chapter 18 will cover all the
different kinds of patterns and what they do. The power of `match` comes from
the expressiveness of the patterns and the compiler checks that make sure all
possible cases are handled.