Skip to content

Commit 7bfcace

Browse files
committed
Use cargo run in more places
1 parent 80b45dd commit 7bfcace

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

Diff for: src/doc/guide.md

+21-26
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ Try it out:
18131813

18141814
```{notrust,ignore}
18151815
$ cargo run
1816-
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1816+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
18171817
Running `target/guessing_game`
18181818
Hello, world!
18191819
```
@@ -1955,17 +1955,12 @@ fn main() {
19551955
}
19561956
```
19571957

1958-
... and then recompile:
1958+
Try running our new program a few times:
19591959

19601960
```{notrust,ignore}
1961-
$ cargo build
1962-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
1963-
```
1964-
1965-
Excellent! Try running our new program a few times:
1966-
1967-
```{notrust,ignore}
1968-
$ ./target/guessing_game
1961+
$ cargo run
1962+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
1963+
Running `target/guessing_game`
19691964
Guess the number!
19701965
The secret number is: 7
19711966
Please input your guess.
@@ -2016,9 +2011,9 @@ fn main() {
20162011
And trying it out:
20172012

20182013
```{notrust,ignore}
2019-
$ cargo build
2020-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2021-
$ ./target/guessing_game
2014+
$ cargo run
2015+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2016+
Running `target/guessing_game`
20222017
Guess the number!
20232018
The secret number is: 57
20242019
Please input your guess.
@@ -2287,9 +2282,9 @@ We use a `match` to either give us the `uint` inside of the `Option`, or we
22872282
print an error message and return. Let's give this a shot:
22882283

22892284
```{notrust,ignore}
2290-
$ cargo build
2291-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2292-
$ ./target/guessing_game
2285+
$ cargo run
2286+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2287+
Running `target/guessing_game`
22932288
Guess the number!
22942289
The secret number is: 17
22952290
Please input your guess.
@@ -2352,9 +2347,9 @@ fn cmp(a: uint, b: uint) -> Ordering {
23522347
Let's try it!
23532348

23542349
```{notrust,ignore}
2355-
$ cargo build
2356-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2357-
$ ./target/guessing_game
2350+
$ cargo run
2351+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2352+
Running `target/guessing_game`
23582353
Guess the number!
23592354
The secret number is: 58
23602355
Please input your guess.
@@ -2429,9 +2424,9 @@ And try it out. But wait, didn't we just add an infinite loop? Yup. Remember
24292424
that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24302425

24312426
```{notrust,ignore}
2432-
$ cargo build
2433-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2434-
$ ./target/guessing_game
2427+
$ cargo run
2428+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2429+
Running `target/guessing_game`
24352430
Guess the number!
24362431
The secret number is: 59
24372432
Please input your guess.
@@ -2560,10 +2555,10 @@ fn cmp(a: uint, b: uint) -> Ordering {
25602555

25612556
Now we should be good! Let's try:
25622557

2563-
```{rust,ignore}
2564-
$ cargo build
2565-
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
2566-
$ ./target/guessing_game
2558+
```{notrust,ignore}
2559+
$ cargo run
2560+
Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)
2561+
Running `target/guessing_game`
25672562
Guess the number!
25682563
The secret number is: 61
25692564
Please input your guess.

0 commit comments

Comments
 (0)