diff options
| author | Oren Hazi <oren.hazi@gmail.com> | 2014-09-18 00:52:42 -0700 |
|---|---|---|
| committer | Oren Hazi <oren.hazi@gmail.com> | 2014-09-18 00:52:42 -0700 |
| commit | c942df9fa590d53a87a1c47aba5938c7f7d100b6 (patch) | |
| tree | 6a06a86ad46d2373742d974ac3ee14802b7b3c95 | |
| parent | 35be9b817d897d9a15cbf84eb450ab8ea80b7207 (diff) | |
from_str has an impl for uint, not Option<uint>
| -rw-r--r-- | src/doc/guide.md | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/doc/guide.md b/src/doc/guide.md index 2f16c783446..39979f3792d 100644 --- a/src/doc/guide.md +++ b/src/doc/guide.md @@ -2153,14 +2153,10 @@ 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 input_num = from_str::<Option<uint>>("5"); +let input_num = from_str::<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 -the former. I think the nested `<>`s make the first option especially ugly and -a bit harder to read. - Anyway, with us now converting our input to a number, our code looks like this: ```{rust,ignore} |
