Skip to content

Commit 4b6ea4f

Browse files
committed
Use cargo run in more places
1 parent 5fb2dfa commit 4b6ea4f

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

src/doc/guide.md

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ Try it out:
18141814

18151815
```{notrust,ignore}
18161816
$ cargo run
1817-
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1817+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
18181818
Running `target/guessing_game`
18191819
Hello, world!
18201820
$
@@ -1957,18 +1957,12 @@ fn main() {
19571957
}
19581958
```
19591959

1960-
... and then recompile:
1960+
Try running our new program a few times:
19611961

19621962
```{notrust,ignore}
1963-
$ cargo build
1964-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
1965-
$
1966-
```
1967-
1968-
Excellent! Try running our new program a few times:
1969-
1970-
```{notrust,ignore}
1971-
$ ./target/guessing_game
1963+
$ cargo run
1964+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
1965+
Running `target/guessing_game`
19721966
Guess the number!
19731967
The secret number is: 7
19741968
Please input your guess.
@@ -2019,9 +2013,9 @@ fn main() {
20192013
And trying it out:
20202014

20212015
```{notrust,ignore}
2022-
$ cargo build
2023-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2024-
$ ./target/guessing_game
2016+
$ cargo run
2017+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2018+
Running `target/guessing_game`
20252019
Guess the number!
20262020
The secret number is: 57
20272021
Please input your guess.
@@ -2290,9 +2284,9 @@ We use a `match` to either give us the `uint` inside of the `Option`, or we
22902284
print an error message and return. Let's give this a shot:
22912285

22922286
```{notrust,ignore}
2293-
$ cargo build
2294-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2295-
$ ./target/guessing_game
2287+
$ cargo run
2288+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2289+
Running `target/guessing_game`
22962290
Guess the number!
22972291
The secret number is: 17
22982292
Please input your guess.
@@ -2356,9 +2350,9 @@ fn cmp(a: uint, b: uint) -> Ordering {
23562350
Let's try it!
23572351

23582352
```{notrust,ignore}
2359-
$ cargo build
2360-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2361-
$ ./target/guessing_game
2353+
$ cargo run
2354+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2355+
Running `target/guessing_game`
23622356
Guess the number!
23632357
The secret number is: 58
23642358
Please input your guess.
@@ -2434,9 +2428,9 @@ And try it out. But wait, didn't we just add an infinite loop? Yup. Remember
24342428
that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24352429

24362430
```{notrust,ignore}
2437-
$ cargo build
2438-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2439-
$ ./target/guessing_game
2431+
$ cargo run
2432+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2433+
Running `target/guessing_game`
24402434
Guess the number!
24412435
The secret number is: 59
24422436
Please input your guess.
@@ -2567,9 +2561,9 @@ fn cmp(a: uint, b: uint) -> Ordering {
25672561
Now we should be good! Let's try:
25682562

25692563
```{rust,ignore}
2570-
$ cargo build
2571-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2572-
$ ./target/guessing_game
2564+
$ cargo run
2565+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2566+
Running `target/guessing_game`
25732567
Guess the number!
25742568
The secret number is: 61
25752569
Please input your guess.

0 commit comments

Comments
 (0)