Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid introducing run twice in the Rust book #36878

Merged
merged 1 commit into from
Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/doc/book/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ $ cargo run
Hello, world!
```

The `run` command comes in handy when you need to rapidly iterate on a
project.

Notice that this example didn’t re-build the project. Cargo figured out that
the file hasn’t changed, and so it just ran the binary. If you'd modified your
source code, Cargo would have rebuilt the project before running it, and you
Expand Down
9 changes: 3 additions & 6 deletions src/doc/book/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ $ cargo build
Excellent! Open up your `src/main.rs` again. We’ll be writing all of
our code in this file.

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

```bash
$ cargo run
Expand All @@ -67,9 +65,8 @@ $ cargo run
Hello, world!
```

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

# Processing a Guess

Expand Down