Skip to content

Commit

Permalink
input_num is used is used instead of guess further in the guide
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardoBautista committed Aug 19, 2014
1 parent 7ebb392 commit 6d18922
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/doc/guide.md
Expand Up @@ -2148,7 +2148,7 @@ a function for that:
let input = io::stdin().read_line()
.ok()
.expect("Failed to read line");
let guess: Option<uint> = from_str(input.as_slice());
let input_num: Option<uint> = from_str(input.as_slice());
```

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

```{rust,ignore}
let guess = from_str::<Option<uint>>("5");
let guess: Option<uint> = from_str("5");
let input_num = from_str::<Option<uint>>("5");
let input_num: Option<uint> = from_str("5");
```

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

0 comments on commit 6d18922

Please sign in to comment.