Skip to content

Commit a22b327

Browse files
committed
book: typo fixes, wording improvements.
The text in iterators.md wasn't wrong, but it read awkwardly to my ear.
1 parent 67dfc17 commit a22b327

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

src/doc/trpl/enums.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ Character::Digit(10);
5656
Hand::Digit;
5757
```
5858

59-
Both variants are named `Digit`, but since they’re scoped to the `enum` name,
59+
Both variants are named `Digit`, but since they’re scoped to the `enum` name
60+
there's no ambiguity.
6061

6162
Not supporting these operations may seem rather limiting, but it’s a limitation
6263
which we can overcome. There are two ways: by implementing equality ourselves,

src/doc/trpl/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Because these kinds of situations are relatively rare, use panics sparingly.
204204

205205
In certain circumstances, even though a function may fail, we may want to treat
206206
it as a panic instead. For example, `io::stdin().read_line(&mut buffer)` returns
207-
an `Result<usize>`, when there is an error reading the line. This allows us to
207+
a `Result<usize>`, when there is an error reading the line. This allows us to
208208
handle and possibly recover from error.
209209

210210
If we don't want to handle this error, and would rather just abort the program,

src/doc/trpl/iterators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ see why consumers matter.
212212
As we've said before, an iterator is something that we can call the
213213
`.next()` method on repeatedly, and it gives us a sequence of things.
214214
Because you need to call the method, this means that iterators
215-
are *lazy* and don't need to generate all of the values upfront.
216-
This code, for example, does not actually generate the numbers
217-
`1-100`, and just creates a value that represents the sequence:
215+
can be *lazy* and not generate all of the values upfront. This code,
216+
for example, does not actually generate the numbers `1-100`, instead
217+
creating a value that merely represents the sequence:
218218

219219
```rust
220220
let nums = 1..100;

src/doc/trpl/lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ With that in mind, let’s learn about lifetimes.
4141
# Lifetimes
4242

4343
Lending out a reference to a resource that someone else owns can be
44-
complicated, however. For example, imagine this set of operations:
44+
complicated. For example, imagine this set of operations:
4545

4646
- I acquire a handle to some kind of resource.
4747
- I lend you a reference to the resource.

src/doc/trpl/ownership.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ println!("v[0] is: {}", v[0]);
108108

109109
Same error: “use of moved value.” When we transfer ownership to something else,
110110
we say that we’ve ‘moved’ the thing we refer to. You don’t need some sort of
111-
special annotation here, it’s the default thing that Rust does.
111+
special annotation here; it’s the default thing that Rust does.
112112

113113
## The details
114114

src/doc/trpl/primitive-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Let’s go over them by category:
8282
Integer types come in two varieties: signed and unsigned. To understand the
8383
difference, let’s consider a number with four bits of size. A signed, four-bit
8484
number would let you store numbers from `-8` to `+7`. Signed numbers use
85-
“two’s compliment representation”. An unsigned four bit number, since it does
85+
“two’s complement representation”. An unsigned four bit number, since it does
8686
not need to store negatives, can store values from `0` to `+15`.
8787

8888
Unsigned types use a `u` for their category, and signed types use `i`. The `i`

0 commit comments

Comments
 (0)