diff --git a/src/ch01-03-hello-world.md b/src/ch01-03-hello-world.md index 703834177..75c67b87c 100644 --- a/src/ch01-03-hello-world.md +++ b/src/ch01-03-hello-world.md @@ -361,7 +361,7 @@ executable application, as opposed to a library. Executables are often called *binaries* (as in `/usr/bin`, if you’re on a Unix system). Cargo has generated two files and one directory for us: a `Cargo.toml` and a -*src* directory with a *main.rs* file inside. These should look familliar, +*src* directory with a *main.rs* file inside. These should look familiar, they’re exactly what we created by hand, above. This output is all you need to get started. First, open `Cargo.toml`. It should diff --git a/src/ch03-04-scalar-types.md b/src/ch03-04-scalar-types.md index ce2209aab..93214d006 100644 --- a/src/ch03-04-scalar-types.md +++ b/src/ch03-04-scalar-types.md @@ -89,7 +89,7 @@ two possible values: ```rust fn main() { let t = true; - let f: bool = false; // with explict type annotation + let f: bool = false; // with explicit type annotation } ``` @@ -110,7 +110,7 @@ fn main() { Rust’s `char` represents a [Unicode Scalar Value], which means that it can represent a lot more than just ASCII. ‘Character’ isn’t really a concept in -Unicode, however: your human intutition for what a ‘character’ is may not match +Unicode, however: your human intuition for what a ‘character’ is may not match up with a `char`. It also means that `char`s are four bytes each. [Unicode Scalar Value]: http://www.unicode.org/glossary/#unicode_scalar_value diff --git a/src/ch03-05-compound-types.md b/src/ch03-05-compound-types.md index c648ff5ea..286547d76 100644 --- a/src/ch03-05-compound-types.md +++ b/src/ch03-05-compound-types.md @@ -55,7 +55,7 @@ As you can see, the first index is `0`. ### Single-element tuples There’s one last trick with tuples: `(5)` is actually ambiguous: is it a tuple, -or is it a `5` in parethesis? If you need to disambiguate, use a comma: +or is it a `5` in parenthesis? If you need to disambiguate, use a comma: ```rust fn main() { diff --git a/src/ch04-02-ownership.md b/src/ch04-02-ownership.md index cfa7514d8..5083c135d 100644 --- a/src/ch04-02-ownership.md +++ b/src/ch04-02-ownership.md @@ -131,10 +131,10 @@ to the operating system: when it goes out of scope! When a variable goes out of scope, a special function is called. This function is called `drop()`, and it is where the author of `String` can put the code to return the memory. -> Aside: This pattern is sometimes called “Resource Aquisition Is +> Aside: This pattern is sometimes called “Resource Acquisition Is > Initialization” in C++, or “RAII” for short. While they are very similar, > Rust’s take on this concept has a number of differences, and so we don’t tend -> to use the same term. If you’re familliar with this idea, keep in mind that it +> to use the same term. If you’re familiar with this idea, keep in mind that it > is _roughly_ similar in Rust, but not identical. This pattern has a profound impact on the way that Rust code is written. It may @@ -404,7 +404,7 @@ fn takes_and_gives_back(a_string: String) -> String { } ``` -With simililar annotations: +With similiar annotations: ```rust fn main() { diff --git a/src/ch04-03-references-and-borrowing.md b/src/ch04-03-references-and-borrowing.md index 5a3c38922..b53dca7e4 100644 --- a/src/ch04-03-references-and-borrowing.md +++ b/src/ch04-03-references-and-borrowing.md @@ -180,7 +180,7 @@ let mut s = String::from("hello"); let r2 = &mut s; ``` -There is a simlar rule for combining the two kinds of references. This code errors: +There is a similar rule for combining the two kinds of references. This code errors: ```rust,ignore let mut s = String::from("hello"); diff --git a/src/ch04-04-slices.md b/src/ch04-04-slices.md index 90e1b23ac..3d028635d 100644 --- a/src/ch04-04-slices.md +++ b/src/ch04-04-slices.md @@ -110,7 +110,7 @@ Now we’re tracking both a start _and_ and ending index. Even more chances for things to go wrong. We now have three unrelated variable bindings floating around which need to be kept in sync. -Luckily, Rust has a solution to this probem: string slices. +Luckily, Rust has a solution to this problem: string slices. # String slices diff --git a/src/ch05-02-method-syntax.md b/src/ch05-02-method-syntax.md index 00242081f..89e8ba354 100644 --- a/src/ch05-02-method-syntax.md +++ b/src/ch05-02-method-syntax.md @@ -12,7 +12,7 @@ let s2 = s1.clone(); println!("{}", s1); ``` -The call to `clone()` is attatched to `s1` with a dot. This is called ‘method +The call to `clone()` is attached to `s1` with a dot. This is called ‘method syntax’, and it’s a way to call certain functions with a different style. Why have two ways to call functions? We’ll talk about some deeper reasons @@ -127,7 +127,7 @@ fn distance(p1: Point, p2: Point) -> f64 { # } ``` -Other than this, the rest of the example is familliar: an implementation of +Other than this, the rest of the example is familiar: an implementation of `distance()`, and using the method to find an answer. There are two differences. The first is in the first argument. Instead of a name diff --git a/src/ch05-03-generics.md b/src/ch05-03-generics.md index 32d91ab20..eab064696 100644 --- a/src/ch05-03-generics.md +++ b/src/ch05-03-generics.md @@ -176,7 +176,7 @@ println!("x is: {}", x); ``` We can't print out `x`! The error messages reference something we talked about -breifly before, the `Display` trait. In order to implement this function, we +briefly before, the `Display` trait. In order to implement this function, we need to talk about traits. But we only need to talk about traits to implement our own generic functions; we don't need this understanding to use them. So rather than get into more details about this right now, let's talk about other diff --git a/src/ch06-03-match.md b/src/ch06-03-match.md index d3f241725..1e4696d88 100644 --- a/src/ch06-03-match.md +++ b/src/ch06-03-match.md @@ -158,7 +158,7 @@ match some_u8_value { The `_` pattern matches anything at all, and so with it as the final pattern, Rust can understand that we have all our bases covered. It's not only used for -this sort of exhastiveness issue, though. It's useful any time we don't want to +this sort of exhaustiveness issue, though. It's useful any time we don't want to deal with a number of cases. Consider this scenario: if we wanted to print out something one one, three, five, and seven: