Skip to content

Commit 3f25c5c

Browse files
committed
Rollup merge of rust-lang#30038 - Carreau:cargo-philosopher, r=steveklabnik
At this point of the book, reader have likely use `cargo new --bin`, likely 2 times, once if they are lazy. This remind them of the `cargo` syntax. I was myself unsure whether it was `cargo create`, `cargo new`, and whether it would initialize in current working directory or needed a target. -- Otherwise thanks, I've been writing rust for a few hours, and likes it so far.
2 parents 4a8f200 + 5aa4507 commit 3f25c5c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/doc/book/dining-philosophers.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,17 @@ Now, let’s imagine this sequence of events:
4545
6. ... ? All the forks are taken, but nobody can eat!
4646

4747
There are different ways to solve this problem. We’ll get to our solution in
48-
the tutorial itself. For now, let’s get started modeling the problem itself.
49-
We’ll start with the philosophers:
48+
the tutorial itself. For now, let’s get started and create a new project with
49+
`cargo`:
50+
51+
```bash
52+
$ cd ~/projects
53+
$ cargo new dining_philosophers --bin
54+
$ cd dining_philosophers
55+
```
56+
57+
Now we can start modeling the problem itself. We’ll start with the philosophers
58+
in `src/main.rs`:
5059

5160
```rust
5261
struct Philosopher {

0 commit comments

Comments
 (0)