diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-11-25 09:21:18 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-11-25 09:21:18 +0530 |
| commit | 3f25c5c655ed54ee09f8018029aedad9dde797bd (patch) | |
| tree | deee6c80a45cd2e3411200965c41a27b9cfb4709 | |
| parent | 4a8f2004a6c8af34acac65558c13c500c301ac07 (diff) | |
| parent | 5aa45071db5d00137702e8dbde4af943dcff5de0 (diff) | |
| download | rust-3f25c5c655ed54ee09f8018029aedad9dde797bd.tar.gz rust-3f25c5c655ed54ee09f8018029aedad9dde797bd.zip | |
Rollup merge of #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.
| -rw-r--r-- | src/doc/book/dining-philosophers.md | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/doc/book/dining-philosophers.md b/src/doc/book/dining-philosophers.md index 50d758c3a10..ace0fbc821a 100644 --- a/src/doc/book/dining-philosophers.md +++ b/src/doc/book/dining-philosophers.md @@ -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 { |
