Skip to content

Rust Book Guessing Game Refers To Incorrect Option Type #22905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
trishume opened this issue Feb 28, 2015 · 3 comments
Closed

Rust Book Guessing Game Refers To Incorrect Option Type #22905

trishume opened this issue Feb 28, 2015 · 3 comments

Comments

@trishume
Copy link

The guessing game section of the Rust book has the line:

let input_num: Result<u32, _> = input.parse();

but multiple places nearby refer to unwrapping it with .ok() to produce an Option, which is never actually done in the code examples. It seems someone updated the code to directly use the Result<u32,_> and didn't update the surrounding text and the type error message.

This should be an easy fix but at the moment I'm a Rust newbie and I don't have a rust compiler to determine the correct type and error message.

@djmally
Copy link
Contributor

djmally commented Feb 28, 2015

I'll take a look into this. I'm a bit of a Rust newbie myself, but this seems like a pretty easy fix and I do have the tools available.

@djmally
Copy link
Contributor

djmally commented Feb 28, 2015

Submitted a PR for this as #22911.

@sanxiyn sanxiyn added the A-book label Mar 2, 2015
@teotwaki
Copy link

teotwaki commented Mar 5, 2015

@trishume Can this be closed? @djmally's fix has been applied to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants