Skip to content

Commit a25925a

Browse files
committed
Rollup merge of rust-lang#25472 - WillEngler:book-tiny-typo-fixes, r=alexcrichton
This PR fixes two little typos in the Dining Philosophers example. Also, there are two style points that may have been oversights but may have been deliberate, so I'll just bring them up here: 1) In the last paragraph, you say > You’ll notice we can introduce a new binding to `table` here, and it will shadow the old one. This is often used so that you don’t need to come up with two unique names. You already said something similar to this in the Guessing Game, but maybe you intended for this example to be independent of that one. 2) In "Rust Inside Other Languages," you introduce the idea of the "global interpreter lock" and then refer to it as the GIL a few paragraphs later without explicitly stating that GIL == global interpreter lock. It's reasonable to expect readers to make the connection, but maybe that's not what you intended. Excellent work on the examples! Congrats on 1.0! r? @steveklabnik
2 parents e06eb1c + d5394d0 commit a25925a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/doc/trpl/dining-philosophers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ from the standard library, and so we need to `use` it.
320320
We now print out two messages, with a `sleep_ms()` in the middle. This will
321321
simulate the time it takes a philosopher to eat.
322322

323-
If you run this program, You should see each philosopher eat in turn:
323+
If you run this program, you should see each philosopher eat in turn:
324324

325325
```text
326326
Baruch Spinoza is eating.
@@ -480,7 +480,7 @@ struct Table {
480480
}
481481
```
482482

483-
This `Table` has an vector of `Mutex`es. A mutex is a way to control
483+
This `Table` has a vector of `Mutex`es. A mutex is a way to control
484484
concurrency: only one thread can access the contents at once. This is exactly
485485
the property we need with our forks. We use an empty tuple, `()`, inside the
486486
mutex, since we’re not actually going to use the value, just hold onto it.

0 commit comments

Comments
 (0)