@@ -1769,7 +1769,7 @@ Check out the generated `Cargo.toml`:
1769
1769
[package]
1770
1770
1771
1771
name = "guessing_game"
1772
- version = "0.1.0 "
1772
+ version = "0.0.1 "
1773
1773
authors = ["Your Name <[email protected] >"]
1774
1774
```
1775
1775
@@ -1788,7 +1788,7 @@ Let's try compiling what Cargo gave us:
1788
1788
1789
1789
``` {bash}
1790
1790
$ cargo build
1791
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1791
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
1792
1792
$
1793
1793
```
1794
1794
@@ -1901,7 +1901,7 @@ Let's try to compile this using `cargo build`:
1901
1901
1902
1902
``` {notrust,no_run}
1903
1903
$ cargo build
1904
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1904
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
1905
1905
src/main.rs:7:26: 7:34 error: the type of this value must be known in this context
1906
1906
src/main.rs:7 let secret_number = (rand::random() % 100i) + 1i;
1907
1907
^~~~~~~~
@@ -1949,7 +1949,7 @@ fn main() {
1949
1949
1950
1950
``` {notrust,ignore}
1951
1951
$ cargo build
1952
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1952
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
1953
1953
$
1954
1954
```
1955
1955
@@ -2008,8 +2008,8 @@ And trying it out:
2008
2008
2009
2009
``` {notrust,ignore}
2010
2010
$ cargo build
2011
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2012
- $ ./target/guessing_game
2011
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
2012
+ $ ./target/guessing_game
2013
2013
Guess the number!
2014
2014
The secret number is: 57
2015
2015
Please input your guess.
@@ -2063,7 +2063,7 @@ If we try to compile, we'll get some errors:
2063
2063
2064
2064
``` {notrust,ignore}
2065
2065
$ cargo build
2066
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2066
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
2067
2067
src/main.rs:20:15: 20:20 error: mismatched types: expected `int` but found `collections::string::String` (expected int but found struct collections::string::String)
2068
2068
src/main.rs:20 match cmp(input, secret_number) {
2069
2069
^~~~~
@@ -2117,7 +2117,7 @@ And try compiling again:
2117
2117
2118
2118
``` {notrust,ignore}
2119
2119
$ cargo build
2120
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2120
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
2121
2121
src/main.rs:20:15: 20:20 error: mismatched types: expected `uint` but found `collections::string::String` (expected uint but found struct collections::string::String)
2122
2122
src/main.rs:20 match cmp(input, secret_number) {
2123
2123
^~~~~
@@ -2220,7 +2220,7 @@ Let's try it out!
2220
2220
2221
2221
``` {notrust,ignore}
2222
2222
$ cargo build
2223
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2223
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
2224
2224
src/main.rs:22:15: 22:24 error: mismatched types: expected `uint` but found `core::option::Option<uint>` (expected uint but found enum core::option::Option)
2225
2225
src/main.rs:22 match cmp(input_num, secret_number) {
2226
2226
^~~~~~~~~
@@ -2345,8 +2345,8 @@ Let's try it!
2345
2345
2346
2346
``` {notrust,ignore}
2347
2347
$ cargo build
2348
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2349
- $ ./target/guessing_game
2348
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
2349
+ $ ./target/guessing_game
2350
2350
Guess the number!
2351
2351
The secret number is: 58
2352
2352
Please input your guess.
@@ -2423,8 +2423,8 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
2423
2423
2424
2424
``` {notrust,ignore}
2425
2425
$ cargo build
2426
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2427
- $ ./target/guessing_game
2426
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
2427
+ $ ./target/guessing_game
2428
2428
Guess the number!
2429
2429
The secret number is: 59
2430
2430
Please input your guess.
@@ -2556,8 +2556,8 @@ Now we should be good! Let's try:
2556
2556
2557
2557
``` {rust,ignore}
2558
2558
$ cargo build
2559
- Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2560
- $ ./target/guessing_game
2559
+ Compiling guessing_game v0.0.1 (file:/home/you/projects/guessing_game)
2560
+ $ ./target/guessing_game
2561
2561
Guess the number!
2562
2562
The secret number is: 61
2563
2563
Please input your guess.
0 commit comments