Skip to content

Commit c942df9

Browse files
committed
from_str has an impl for uint, not Option<uint>
1 parent 35be9b8 commit c942df9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/doc/guide.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,14 +2153,10 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
21532153
tell `random()` what to generate. In a similar fashion, both of these work:
21542154

21552155
```{rust,ignore}
2156-
let input_num = from_str::<Option<uint>>("5");
2156+
let input_num = from_str::<uint>("5");
21572157
let input_num: Option<uint> = from_str("5");
21582158
```
21592159

2160-
In this case, I happen to prefer the latter, and in the `random()` case, I prefer
2161-
the former. I think the nested `<>`s make the first option especially ugly and
2162-
a bit harder to read.
2163-
21642160
Anyway, with us now converting our input to a number, our code looks like this:
21652161

21662162
```{rust,ignore}

0 commit comments

Comments
 (0)