Skip to content

Commit 5aa4507

Browse files
committed
Add cargo instructions for dinning_philosopher project
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.
1 parent 1004860 commit 5aa4507

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)