Skip to content

Commit cbdae97

Browse files
committed
auto merge of rust-lang#16234 : cakebaker/rust/rename_guessing_game_rs_to_main_rs, r=steveklabnik
Follow-up to rust-lang#16215
2 parents fde58d9 + d0bd10b commit cbdae97

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/doc/guide.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1647,14 +1647,14 @@ $ cargo build
16471647
$
16481648
```
16491649

1650-
Excellent! Open up your `src/guessing_game.rs` again. We'll be writing all of
1650+
Excellent! Open up your `src/main.rs` again. We'll be writing all of
16511651
our code in this file. We'll talk about multiple-file projects later on in the
16521652
guide.
16531653

16541654
## Processing a Guess
16551655

16561656
Let's get to it! The first thing we need to do for our guessing game is
1657-
allow our player to input a guess. Put this in your `src/guessing_game.rs`:
1657+
allow our player to input a guess. Put this in your `src/main.rs`:
16581658

16591659
```{rust,no_run}
16601660
use std::io;
@@ -1734,9 +1734,9 @@ this using `cargo build`:
17341734
```{notrust,no_run}
17351735
$ cargo build
17361736
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1737-
src/guessing_game.rs:7:26: 7:34 error: the type of this value must be known in this context
1738-
src/guessing_game.rs:7 let secret_number = (rand::random() % 100i) + 1i;
1739-
^~~~~~~~
1737+
src/main.rs:7:26: 7:34 error: the type of this value must be known in this context
1738+
src/main.rs:7 let secret_number = (rand::random() % 100i) + 1i;
1739+
^~~~~~~~
17401740
error: aborting due to previous error
17411741
```
17421742

@@ -1896,12 +1896,12 @@ If we try to compile, we'll get some errors:
18961896
```{notrust,ignore}
18971897
$ cargo build
18981898
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1899-
src/guessing_game.rs:20:15: 20:20 error: mismatched types: expected `int` but found `collections::string::String` (expected int but found struct collections::string::String)
1900-
src/guessing_game.rs:20 match cmp(input, secret_number) {
1901-
^~~~~
1902-
src/guessing_game.rs:20:22: 20:35 error: mismatched types: expected `int` but found `uint` (expected int but found uint)
1903-
src/guessing_game.rs:20 match cmp(input, secret_number) {
1904-
^~~~~~~~~~~~~
1899+
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)
1900+
src/main.rs:20 match cmp(input, secret_number) {
1901+
^~~~~
1902+
src/main.rs:20:22: 20:35 error: mismatched types: expected `int` but found `uint` (expected int but found uint)
1903+
src/main.rs:20 match cmp(input, secret_number) {
1904+
^~~~~~~~~~~~~
19051905
error: aborting due to 2 previous errors
19061906
```
19071907

@@ -1950,9 +1950,9 @@ And try compiling again:
19501950
```{notrust,ignore}
19511951
$ cargo build
19521952
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1953-
src/guessing_game.rs:20:15: 20:20 error: mismatched types: expected `uint` but found `collections::string::String` (expected uint but found struct collections::string::String)
1954-
src/guessing_game.rs:20 match cmp(input, secret_number) {
1955-
^~~~~
1953+
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)
1954+
src/main.rs:20 match cmp(input, secret_number) {
1955+
^~~~~
19561956
error: aborting due to previous error
19571957
```
19581958

@@ -2053,9 +2053,9 @@ Let's try it out!
20532053
```{notrust,ignore}
20542054
$ cargo build
20552055
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2056-
src/guessing_game.rs:22:15: 22:24 error: mismatched types: expected `uint` but found `core::option::Option<uint>` (expected uint but found enum core::option::Option)
2057-
src/guessing_game.rs:22 match cmp(input_num, secret_number) {
2058-
^~~~~~~~~
2056+
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)
2057+
src/main.rs:22 match cmp(input_num, secret_number) {
2058+
^~~~~~~~~
20592059
error: aborting due to previous error
20602060
```
20612061

0 commit comments

Comments
 (0)