Skip to content

Commit 6d18922

Browse files
input_num is used is used instead of guess further in the guide
1 parent 7ebb392 commit 6d18922

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/guide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,7 @@ a function for that:
21482148
let input = io::stdin().read_line()
21492149
.ok()
21502150
.expect("Failed to read line");
2151-
let guess: Option<uint> = from_str(input.as_slice());
2151+
let input_num: Option<uint> = from_str(input.as_slice());
21522152
```
21532153

21542154
The `from_str` function takes in a `&str` value and converts it into something.
@@ -2170,8 +2170,8 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
21702170
tell `random()` what to generate. In a similar fashion, both of these work:
21712171

21722172
```{rust,ignore}
2173-
let guess = from_str::<Option<uint>>("5");
2174-
let guess: Option<uint> = from_str("5");
2173+
let input_num = from_str::<Option<uint>>("5");
2174+
let input_num: Option<uint> = from_str("5");
21752175
```
21762176

21772177
In this case, I happen to prefer the latter, and in the `random()` case, I prefer

0 commit comments

Comments
 (0)