Fix typos detected by aspell

This commit is contained in:
Boris Egorov 2016-12-02 00:54:45 +07:00
parent 7836b5fb1f
commit b77aa4f5db
10 changed files with 12 additions and 12 deletions

View File

@ -205,7 +205,7 @@ We've been showing a bunch of different possibilities that we could define in
our code for storing IP addresses of the two different kinds using an enum. It
turns out, though, that wanting to store IP addresses and encode which kind
they are is so common that the standard library has a definition we can use!
Let's look at how the standard libary defines `IpAddr`: it has the exact enum
Let's look at how the standard library defines `IpAddr`: it has the exact enum
and variants that we've defined and used, but it chose to embed the address
data inside the variants in the form of two different structs, which are
defined differently for each variant:

View File

@ -708,7 +708,7 @@ Overall, these are the rules for item visibility:
### Privacy Examples
Lets look at a few more examples to get some practice. Create a new libary
Lets look at a few more examples to get some practice. Create a new library
project and enter the code in Listing 7-5 into your new projects `src/lib.rs`:
Filename: src/lib.rs

View File

@ -224,7 +224,7 @@ We've been showing a bunch of different possibilities that we could define in
our code for storing IP addresses of the two different kinds using an enum. It
turns out, though, that wanting to store IP addresses and encode which kind
they are is so common that [the standard library has a definition we can
use!][IpAddr]<!-- ignore --> Let's look at how the standard libary defines
use!][IpAddr]<!-- ignore --> Let's look at how the standard library defines
`IpAddr`: it has the exact enum and variants that we've defined and used, but
it chose to embed the address data inside the variants in the form of two
different structs, which are defined differently for each variant:

View File

@ -215,7 +215,7 @@ Overall, these are the rules for item visibility:
### Privacy Examples
Lets look at a few more examples to get some practice. Create a new libary
Lets look at a few more examples to get some practice. Create a new library
project and enter the code in Listing 7-5 into your new projects *src/lib.rs*:
<figure>

View File

@ -219,7 +219,7 @@ don't think we should repeat it here as well, but we added a reference. /Carol
If you don't know at the time that you're writing a program the exhaustive set
of types the program will get at runtime to store in a vector, the enum
technique won't work. Insetad, you can use a trait object, which we'll cover in
technique won't work. Instead, you can use a trait object, which we'll cover in
Chapter 13.
Now that we've gone over some of the most common ways to use vectors, be sure
@ -233,7 +233,7 @@ in the book for space reasons? We might want to justify sending them out of the
book if we don't want to cover it here -->
<!-- Yes, there are many, many methods on Vec: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html
Also there are occcasionally new methods available with new versions of the
Also there are occasionally new methods available with new versions of the
language, so there's no way we can be comprehensive here. We want the reader to
use the API documentation in these situations since the purpose of the online
docs is to be comprehensive and up to date. I personally wouldn't expect a book

View File

@ -95,7 +95,7 @@ in this short program where the error was, it would be nicer if we could have
Rust tell us what line in our program caused the error.
That's what the next line, the `note` is about. If we set the `RUST_BACKTRACE`
environment variable, we'll get a backtrace of exactly how the error happend.
environment variable, we'll get a backtrace of exactly how the error happened.
Let's try that. Listing 9-1 shows the output:
<figure>

View File

@ -2,7 +2,7 @@
One of the core tools a programming language gives you is the ability to deal
effectively with duplication of code. It's important to minimize the amount of
code that is duplicated throughout a program to make maintenace easier and
code that is duplicated throughout a program to make maintenance easier and
minimize logic errors. Maintenance will be easier if there's only one place
that you need to change the code if you change your mind about how the program
should work, rather than multiple places in the code. If your program's logic

View File

@ -36,7 +36,7 @@ We declare a trait with the `trait` keyword, then the trait's name. In this
case, our trait will describe types which can be printed. Inside of curly
braces, we declare a method signature, but instead of providing an
implementation inside curly braces, we put a semicolon after the signature. A
trait can have multiple methods in its body, with the method signatures listend one per line and each line ending in a semicolon.
trait can have multiple methods in its body, with the method signatures listened one per line and each line ending in a semicolon.
Implementing a trait for a particular type looks similar to implementing
methods on a type since it's also done with the `impl` keyword, but we specify

View File

@ -186,7 +186,7 @@ if left_val == right_val {
}
```
Let's take a look at a test that will fail becasue `hello` is not equal to
Let's take a look at a test that will fail because `hello` is not equal to
`world`. We've also added a custom error message, `greeting operation failed`:
<span class="filename">Filename: src/lib.rs</span>

View File

@ -17,8 +17,8 @@ modifiability. And indeed, it says
> Indeed, under the implementation strategy we outlined above, in which the
> compiler is unaware of threads, it is allowed to transform code subject only
> to sequential cor- rectness constraints and hence could generate the code
> con- taining a race.
> to sequential correctness constraints and hence could generate the code
> containing a race.
However, in Rust, this re-ordering can't happen: Rust won't let you alias x and
y between two threads without some sort of synchronization primitive. But this