Fancy quotes

This commit is contained in:
Carol (Nichols || Goulding) 2016-10-14 22:29:24 -04:00
parent aa1ac85450
commit 4ccc84fdb3
2 changed files with 10 additions and 10 deletions

View File

@ -239,7 +239,7 @@ lines for two method calls. Now lets discuss what this line does.
### Handling Potential Failure with the `Result` Type
As mentioned earlier, `read_line` puts what the user types into the string we're
As mentioned earlier, `read_line` puts what the user types into the string were
passing it, but it also returns a value—in this case, an
`io::Result`. Rust has a number of types named
`Result` in its standard library: a generic `Result` as
@ -511,16 +511,16 @@ fn main() {
Listing 2-3: Code changes needed in order to generate a random number
</caption>
We're adding a `extern crate rand;` line to the top that lets Rust know well be
Were adding a `extern crate rand;` line to the top that lets Rust know well be
using that external dependency. This also does the equivalent of calling `use
rand`, so now we can call anything in the `rand` crate by prefixing it with
`rand::`.
Next, we're adding another `use` line: `use rand::Rng`. `Rng` is a trait that
Next, were adding another `use` line: `use rand::Rng`. `Rng` is a trait that
defines methods that random number generators implement, and this trait must be
in scope for us to use those methods. Chapter 10 will cover traits in detail.
Also, we're adding two more lines in the middle. The `rand::thread_rng` function
Also, were adding two more lines in the middle. The `rand::thread_rng` function
will give us the particular random number generator that were going to use:
one that is local to the current thread of execution and seeded by the
operating system. Next, we call the `gen_range` method on the random number
@ -940,7 +940,7 @@ let guess: u32 = match guess.trim().parse() {
Switching from an `expect` call to a `match` expression is how you generally
move from crash on error to actually handling the error. Remember that `parse`
returns a `Result` type, and `Result` is an enum that has the variants `Ok` or
`Err`. We're using a `match` expression here, like we did with the `Ordering`
`Err`. Were using a `match` expression here, like we did with the `Ordering`
result of the `cmp` method.
If `parse` is able to successfully turn the string into a number, it will return

View File

@ -244,7 +244,7 @@ lines for two method calls. Now lets discuss what this line does.
### Handling Potential Failure with the `Result` Type
As mentioned earlier, `read_line` puts what the user types into the string we're
As mentioned earlier, `read_line` puts what the user types into the string were
passing it, but it also returns a value—in this case, an
[`io::Result`][ioresult]<!-- ignore -->. Rust has a number of types named
`Result` in its standard library: a generic [`Result`][result]<!-- ignore --> as
@ -530,16 +530,16 @@ fn main() {
Listing 2-3: Code changes needed in order to generate a random number
</caption>
We're adding a `extern crate rand;` line to the top that lets Rust know well be
Were adding a `extern crate rand;` line to the top that lets Rust know well be
using that external dependency. This also does the equivalent of calling `use
rand`, so now we can call anything in the `rand` crate by prefixing it with
`rand::`.
Next, we're adding another `use` line: `use rand::Rng`. `Rng` is a trait that
Next, were adding another `use` line: `use rand::Rng`. `Rng` is a trait that
defines methods that random number generators implement, and this trait must be
in scope for us to use those methods. Chapter 10 will cover traits in detail.
Also, we're adding two more lines in the middle. The `rand::thread_rng` function
Also, were adding two more lines in the middle. The `rand::thread_rng` function
will give us the particular random number generator that were going to use:
one that is local to the current thread of execution and seeded by the
operating system. Next, we call the `gen_range` method on the random number
@ -963,7 +963,7 @@ let guess: u32 = match guess.trim().parse() {
Switching from an `expect` call to a `match` expression is how you generally
move from crash on error to actually handling the error. Remember that `parse`
returns a `Result` type, and `Result` is an enum that has the variants `Ok` or
`Err`. We're using a `match` expression here, like we did with the `Ordering`
`Err`. Were using a `match` expression here, like we did with the `Ordering`
result of the `cmp` method.
If `parse` is able to successfully turn the string into a number, it will return