Skip to content

Commit 0c040b0

Browse files
committed
guide: minor copy edits
1 parent 3900c08 commit 0c040b0

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

src/doc/trpl/compound-data-types.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This pattern is very powerful, and we'll see it repeated more later.
4747

4848
There are also a few things you can do with a tuple as a whole, without
4949
destructuring. You can assign one tuple into another, if they have the same
50-
contained types and arity. Tuples have the same arity when they have the same
50+
contained types and [arity]. Tuples have the same arity when they have the same
5151
length.
5252

5353
```rust
@@ -357,6 +357,7 @@ tool that will let us deconstruct this sum type (the type theory term for enums)
357357
in a very elegant way and avoid all these messy `if`/`else`s.
358358

359359

360+
[arity]: ./glossary.html#arity
360361
[match]: ./match.html
361362
[game]: ./guessing-game.html#comparing-guesses
362363
[generics]: ./generics.html

src/doc/trpl/concurrency.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ us enforce that it can't leave the current thread.
4040

4141
### `Sync`
4242

43-
The second of these two trait is called [`Sync`](../std/marker/trait.Sync.html).
43+
The second of these traits is called [`Sync`](../std/marker/trait.Sync.html).
4444
When a type `T` implements `Sync`, it indicates to the compiler that something
4545
of this type has no possibility of introducing memory unsafety when used from
4646
multiple threads concurrently.
4747

4848
For example, sharing immutable data with an atomic reference count is
4949
threadsafe. Rust provides a type like this, `Arc<T>`, and it implements `Sync`,
50-
so that it could be safely shared between threads.
50+
so it is safe to share between threads.
5151

5252
These two traits allow you to use the type system to make strong guarantees
5353
about the properties of your code under concurrency. Before we demonstrate
@@ -69,7 +69,7 @@ fn main() {
6969
}
7070
```
7171

72-
The `Thread::scoped()` method accepts a closure, which is executed in a new
72+
The `thread::scoped()` method accepts a closure, which is executed in a new
7373
thread. It's called `scoped` because this thread returns a join guard:
7474

7575
```
@@ -208,10 +208,10 @@ Here's the error:
208208

209209
```text
210210
<anon>:11:9: 11:22 error: the trait `core::marker::Send` is not implemented for the type `std::sync::mutex::MutexGuard<'_, collections::vec::Vec<u32>>` [E0277]
211-
<anon>:11 Thread::spawn(move || {
211+
<anon>:11 thread::spawn(move || {
212212
^~~~~~~~~~~~~
213213
<anon>:11:9: 11:22 note: `std::sync::mutex::MutexGuard<'_, collections::vec::Vec<u32>>` cannot be sent between threads safely
214-
<anon>:11 Thread::spawn(move || {
214+
<anon>:11 thread::spawn(move || {
215215
^~~~~~~~~~~~~
216216
```
217217

@@ -322,7 +322,6 @@ While this channel is just sending a generic signal, we can send any data that
322322
is `Send` over the channel!
323323

324324
```
325-
use std::sync::{Arc, Mutex};
326325
use std::thread;
327326
use std::sync::mpsc;
328327

src/doc/trpl/crates-and-modules.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ fn main() {
430430
}
431431
```
432432
433-
But it is not idiomatic. This is significantly more likely to introducing a
433+
But it is not idiomatic. This is significantly more likely to introduce a
434434
naming conflict. In our short program, it's not a big deal, but as it grows, it
435435
becomes a problem. If we have conflicting names, Rust will give a compilation
436436
error. For example, if we made the `japanese` functions public, and tried to do

src/doc/trpl/standard-input.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ doesn't work, so we're okay with that. In most cases, we would want to handle
115115
the error case explicitly. `expect()` allows us to give an error message if
116116
this crash happens.
117117

118-
We will cover the exact details of how all of this works later in the Guide.
119-
For now, this gives you enough of a basic understanding to work with.
118+
We will cover the exact details of how all of this works later in the Guide in
119+
[Error Handling]. For now, this gives you enough of a basic understanding to
120+
work with.
120121

121122
Back to the code we were working on! Here's a refresher:
122123

@@ -157,3 +158,6 @@ here.
157158

158159
That's all you need to get basic input from the standard input! It's not too
159160
complicated, but there are a number of small parts.
161+
162+
163+
[Error Handling]: ./error-handling.html

0 commit comments

Comments
 (0)