Skip to content

Commit 704fb9c

Browse files
committed
Merge branch 'doc-fixes' of https://github.com/wheals/rust into rollup
2 parents f26a2a6 + a22b327 commit 704fb9c

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
lines changed

src/doc/trpl/enums.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ fn process_color_change(msg: Message) {
5555
}
5656
```
5757

58-
We’ll see how to safely get data out of enums when we learn about the
59-
[`match`][match] and [`if let`][if-let] statements in the next few
60-
chapters.
58+
Both variants are named `Digit`, but since they’re scoped to the `enum` name
59+
there's no ambiguity.
60+
61+
Not supporting these operations may seem rather limiting, but it’s a limitation
62+
which we can overcome. There are two ways: by implementing equality ourselves,
63+
or by pattern matching variants with [`match`][match] expressions, which you’ll
64+
learn in the next section. We don’t know enough about Rust to implement
65+
equality yet, but we’ll find out in the [`traits`][traits] section.
6166

6267
[match]: match.html
6368
[if-let]: if-let.html

src/doc/trpl/error-handling.md

+1-1
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

+3-3
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

+1-1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ println!("v[0] is: {}", v[0]);
107107
```
108108

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

113113
## The details

src/doc/trpl/primitive-types.md

+1-1
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)