Skip to content

Commit e39a78a

Browse files
authored
Rollup merge of rust-lang#36878 - BlueSpaceCanary:book-dedup-cargo-run-intro, r=GuillaumeGomez
Avoid introducing `run` twice in the Rust book As it stands, getting-started.md and guessing-game.md both introduce `run` as a new command. I switched it so that the 2nd refers back to the first introduction, rather than re-introducing the command. (First ever FOSS PR, sorry if I screwed up anything obvious :) ) r? @steveklabnik
2 parents 5a4ecb4 + bcac486 commit e39a78a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/doc/book/getting-started.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ $ cargo run
505505
Hello, world!
506506
```
507507

508+
The `run` command comes in handy when you need to rapidly iterate on a
509+
project.
510+
508511
Notice that this example didn’t re-build the project. Cargo figured out that
509512
the file hasn’t changed, and so it just ran the binary. If you'd modified your
510513
source code, Cargo would have rebuilt the project before running it, and you

src/doc/book/guessing-game.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ $ cargo build
5656
Excellent! Open up your `src/main.rs` again. We’ll be writing all of
5757
our code in this file.
5858

59-
Before we move on, let me show you one more Cargo command: `run`. `cargo run`
60-
is kind of like `cargo build`, but it also then runs the produced executable.
61-
Try it out:
59+
Remember the `run` command from last chapter? Try it out again here:
6260

6361
```bash
6462
$ cargo run
@@ -67,9 +65,8 @@ $ cargo run
6765
Hello, world!
6866
```
6967

70-
Great! The `run` command comes in handy when you need to rapidly iterate on a
71-
project. Our game is such a project, we need to quickly test each
72-
iteration before moving on to the next one.
68+
Great! Our game is just the kind of project `run` is good for: we need
69+
to quickly test each iteration before moving on to the next one.
7370

7471
# Processing a Guess
7572

0 commit comments

Comments
 (0)