]> git.lizzy.rs Git - rust.git/commitdiff
Add cargo instructions for dinning_philosopher project
authorMatthias Bussonnier <bussonniermatthias@gmail.com>
Tue, 24 Nov 2015 20:58:18 +0000 (21:58 +0100)
committerMatthias Bussonnier <bussonniermatthias@gmail.com>
Tue, 24 Nov 2015 20:58:18 +0000 (21:58 +0100)
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.

src/doc/book/dining-philosophers.md

index 50d758c3a108f9d400f9d9d541f0c9e55d17e17f..ace0fbc821a27764e19b3a0c5fc7a4b06cc971d6 100644 (file)
@@ -45,8 +45,17 @@ Now, let’s imagine this sequence of events:
 6. ... ? All the forks are taken, but nobody can eat!
 
 There are different ways to solve this problem. We’ll get to our solution in
-the tutorial itself. For now, let’s get started modeling the problem itself.
-We’ll start with the philosophers:
+the tutorial itself. For now, let’s get started and create a new project with
+`cargo`:
+
+```bash
+$ cd ~/projects
+$ cargo new dining_philosophers --bin
+$ cd dining_philosophers
+```
+
+Now we can start modeling the problem itself. We’ll start with the philosophers
+in `src/main.rs`:
 
 ```rust
 struct Philosopher {